mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-03 09:19:38 +01:00
37 lines
1.7 KiB
Diff
37 lines
1.7 KiB
Diff
From 3c434790ac382eaa86a47efb3267c4f9db51db46 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 375ac89..22d68af 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -119,4 +119,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 e9c54ee..7705d0d 100644
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
|
@@ -171,6 +171,7 @@ public abstract class World implements IBlockAccess {
|
|
this.N.world = (WorldServer) this;
|
|
this.getServer().addWorld(this.world);
|
|
// CraftBukkit end
|
|
+ this.keepSpawnInMemory = this.paperConfig.keepSpawnInMemory; // Paper
|
|
timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code below can generate new world and access timings
|
|
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
|
|
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
|
|
--
|
|
2.7.2
|
|
|