CavePVP-Stuff/cSpigot-master/spigot-server-Patches/0023-Allow-for-toggling-of-spawn-chunks.patch
2023-05-01 19:59:40 +01:00

39 lines
1.9 KiB
Diff

From de2f4f952a561c597fda5312c2c82f5dee70b5f5 Mon Sep 17 00:00:00 2001
From: Dmck2b <itallhappenedverysuddenly@gmail.com>
Date: Thu, 10 Jul 2014 16:57:10 +0100
Subject: [PATCH] Allow for toggling of spawn chunks
Now with 100% more confirmed working by creator
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 89edd0313..f91c64f45 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -222,6 +222,7 @@ public abstract class World implements IBlockAccess {
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
this.ticksPerMonsterSpawns = this.getServer().getTicksPerMonsterSpawns(); // CraftBukkit
// CraftBukkit end
+ this.keepSpawnInMemory = this.paperSpigotConfig.keepSpawnInMemory; // PaperSpigot
// Spigot start
this.chunkTickRadius = (byte) ( ( this.getServer().getViewDistance() < 7 ) ? this.getServer().getViewDistance() : 7 );
this.chunkTickList = new net.minecraft.util.gnu.trove.map.hash.TLongShortHashMap( spigotConfig.chunksPerTick * 5, 0.7f, Long.MIN_VALUE, Short.MIN_VALUE );
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 1e1a382c3..ca977bc05 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -147,4 +147,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 );
+ }
}
--
2.13.3