PaperSpigot-Parent/CraftBukkit-Patches/0023-Allow-disabling-of-spawn-chunks-always-being-loaded.patch

39 lines
1.5 KiB
Diff
Raw Normal View History

From ac6e927fe693f9aad65e4f891acb012d3c2c851a Mon Sep 17 00:00:00 2001
2014-07-09 01:00:00 +02:00
From: Dmck2b <itallhappenedverysuddenly@gmail.com>
Date: Tue, 8 Jul 2014 23:55:29 +0100
Subject: [PATCH] Allow disabling of spawn chunks always being loaded
2014-07-09 01:00:00 +02:00
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 9741e94..2dc61fc 100644
2014-07-09 01:00:00 +02:00
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -285,6 +285,8 @@ public abstract class World implements IBlockAccess {
2014-07-09 01:00:00 +02:00
this.B();
this.a();
+
+ this.keepSpawnInMemory = paperSpigotConfig.keepSpawnInMemory;
2014-07-09 01:00:00 +02:00
this.getServer().addWorld(this.world); // CraftBukkit
}
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index e627c4e..39bbd62 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -162,4 +162,11 @@ public class PaperSpigotWorldConfig
softDespawnDistance = softDespawnDistance*softDespawnDistance;
hardDespawnDistance = hardDespawnDistance*hardDespawnDistance;
}
+
+ public boolean keepSpawnInMemory;
+ private void keepSpawnInMemory()
+ {
+ keepSpawnInMemory = getBoolean( "keep-spawn-loaded", true );
+ log( "Keep spawn chunk loaded: " + keepSpawnInMemory );
+ }
}
--
1.9.1