3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00
Paper/Spigot-Server-Patches/0013-Allow-for-toggling-of-spawn-chunks.patch
2016-03-03 03:46:49 -06:00

37 Zeilen
1.8 KiB
Diff

From 44d08ff1133630f18994c477b7408a9bca02da16 Mon Sep 17 00:00:00 2001
From: Dmck2b <itallhappenedverysuddenly@gmail.com>
Date: Tue, 1 Mar 2016 13:59:50 -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 a662f26..41747bd 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 93dbc9c..d3d92a3 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -168,6 +168,7 @@ public abstract class World implements IBlockAccess {
this.isClientSide = flag;
this.N = worldprovider.getWorldBorder();
this.getServer().addWorld(this.world); // CraftBukkit
+ 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