papermc/CraftBukkit-Patches/0023-Allow-for-the-toggling-of-persistent-spawn-chunks.patch
2014-07-09 22:06:09 -05:00

41 lines
1.6 KiB
Diff

From 926c4d5892cded795794d47cebf36304fa6198f9 Mon Sep 17 00:00:00 2001
From: Dmck2b <itallhappenedverysuddenly@gmail.com>
Date: Tue, 8 Jul 2014 23:55:29 +0100
Subject: [PATCH] Allow for the toggling of persistent spawn chunks
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 62b732d..04eda07 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -286,7 +286,11 @@ public abstract class World implements IBlockAccess {
this.B();
this.a();
+ this.keepSpawnInMemory = paperSpigotConfig.keepSpawnInMemory; // PaperSpigot
+
this.getServer().addWorld(this.world); // CraftBukkit
+
+ this.getWorld().setKeepSpawnInMemory(this.keepSpawnInMemory); // PaperSpigot
}
protected abstract IChunkProvider j();
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