testserver/Unmapped-Spigot-Server-Patches/0016-Allow-for-toggling-of-...

34 lines
1.8 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2016-03-03 09:46:26 +00:00
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 3 Mar 2016 03:53:43 -0600
2016-02-29 23:09:49 +00:00
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
2020-11-12 01:48:12 +00:00
index 2f0d582baf0eb2bb477944d0cb1369db6ca33956..89e76dd73811fd0f6f8c8e7e5af804d5a4bb5a75 100644
2016-02-29 23:09:49 +00:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2020-11-12 01:48:12 +00:00
@@ -118,4 +118,10 @@ public class PaperWorldConfig {
2016-02-29 23:09:49 +00:00
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/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 1b03c69fa7ffeca4083470a179e18be828b0a957..62735e7908f86e31f7a89ce2071ddebe176c0385 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -217,6 +217,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
2019-04-24 01:00:24 +00:00
});
2016-03-03 09:46:26 +00:00
// CraftBukkit end
2016-03-25 04:59:37 +00:00
timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
2016-02-29 23:09:49 +00:00
+ this.keepSpawnInMemory = this.paperConfig.keepSpawnInMemory; // Paper
2019-04-24 01:00:24 +00:00
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
2016-02-29 23:09:49 +00:00
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
2016-03-25 04:59:37 +00:00
}