papermc/CraftBukkit-Patches/0023-Allow-for-the-toggling-of-persistent-spawn-chunks.patch

42 lines
1.6 KiB
Diff
Raw Normal View History

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