Paper/Spigot-Server-Patches/0127-Don-t-spam-reload-spawn-chunks-in-nether-end.patch
2016-04-18 09:43:19 -05:00

36 lines
1.4 KiB
Diff

From 5f96c6145fc3147316a5c12e75cb650570f6717e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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 9b9d2d7..606ffef 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -3221,6 +3221,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