From 8e68f444f1ef9c9d39bc19c9657a24d8a9b1c5c8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 5 Apr 2016 19:53:30 -0400 Subject: [PATCH] Fix Nether/End world unloading spawn chunks - Fixes #92 --- ...am-reload-spawn-chunks-in-nether-end.patch | 35 +++++++++++++++++++ scripts/importmcdev.sh | 1 + 2 files changed, 36 insertions(+) create mode 100644 Spigot-Server-Patches/0128-Don-t-spam-reload-spawn-chunks-in-nether-end.patch diff --git a/Spigot-Server-Patches/0128-Don-t-spam-reload-spawn-chunks-in-nether-end.patch b/Spigot-Server-Patches/0128-Don-t-spam-reload-spawn-chunks-in-nether-end.patch new file mode 100644 index 0000000000..1937d98c75 --- /dev/null +++ b/Spigot-Server-Patches/0128-Don-t-spam-reload-spawn-chunks-in-nether-end.patch @@ -0,0 +1,35 @@ +From b4c1805159d14e38fede429d131fde0160d3cc88 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Tue, 5 Apr 2016 19:42:22 -0400 +Subject: [PATCH] Don't spam reload spawn chunks in nether/end + + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index 10e40aa..220a942 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -3242,6 +3242,7 @@ public abstract class World implements IBlockAccess { + return this.N; + } + ++ public boolean shouldStayLoaded(int i, int j) { return c(i, j); } // Paper - OBFHELPER + public boolean c(int i, int j) { + BlockPosition blockposition = this.getSpawn(); + int k = i * 16 + 8 - blockposition.getX(); +diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java +index 2d761d4..bc1eaf5 100644 +--- a/src/main/java/net/minecraft/server/WorldProvider.java ++++ b/src/main/java/net/minecraft/server/WorldProvider.java +@@ -127,7 +127,7 @@ public abstract class WorldProvider { + + public void r() {} + +- public boolean c(int i, int j) { +- return true; ++ public boolean c(int i, int j) { // Method is "can chunk unload" ++ return !this.b.shouldStayLoaded(i, j); // Paper - Use shouldStayLoaded check for all worlds + } + } +-- +2.8.0 + diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index 2a7196e047..2017398c24 100755 --- a/scripts/importmcdev.sh +++ b/scripts/importmcdev.sh @@ -61,6 +61,7 @@ import PathfinderAbstract import PathfinderGoalFloat import PersistentVillage import TileEntityEnderChest +import WorldProvider cd "$workdir/Spigot/Spigot-Server/" git add src -A