Paper/Spigot-Server-Patches/0015-Allow-for-toggling-of-spawn-chunks.patch
Aikar 4f7a858bd6
Merge pull request #1248
c2d29a73 PlayerElytraBoostEvent (BillyGalbreath)

* pull/1248/head:
  PlayerElytraBoostEvent

Also merged paper config into parent
2018-07-23 20:29:55 -04:00

37 lines
1.7 KiB
Diff

From 71c3064807448910dfda790cbc35d23fc2f4dae3 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 3 Mar 2016 03:53:43 -0600
Subject: [PATCH] Allow for toggling of spawn chunks
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 02f7e506e..cef0c47ac 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -108,4 +108,10 @@ public class PaperWorldConfig {
softDespawnDistance = softDespawnDistance*softDespawnDistance;
hardDespawnDistance = hardDespawnDistance*hardDespawnDistance;
}
+
+ public boolean keepSpawnInMemory;
+ private void keepSpawnInMemory() {
+ keepSpawnInMemory = getBoolean("keep-spawn-loaded", true);
+ log("Keep spawn chunk loaded: " + keepSpawnInMemory);
+ }
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 562a85b72..6ca7a2069 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -199,6 +199,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
this.getServer().addWorld(this.world);
// CraftBukkit end
timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
+ this.keepSpawnInMemory = this.paperConfig.keepSpawnInMemory; // Paper
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
}
--
2.18.0