Paper/Spigot-Server-Patches/0129-Fix-Chunk-Unload-Queue-Issues.patch
2018-01-10 23:31:19 -06:00

39 lines
1.8 KiB
Diff

From 15a4ee90217c0cb16b07296f8facbe028cb2c415 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 12 May 2016 02:03:56 -0400
Subject: [PATCH] Fix Chunk Unload Queue Issues
Vanilla implemented similar logic as Paper had pre 1.9.4, but Spigot
has not resolved all the bugs with the changes.
This patch fixes known issues and really should be applied by Spigot team.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index f1bcdef5..a847aa07 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -46,7 +46,7 @@ public class Chunk {
private long w;
private int x;
private final ConcurrentLinkedQueue<BlockPosition> y;
- public boolean d;
+ public boolean d; public void setShouldUnload(boolean unload) { this.d = unload; } public boolean isUnloading() { return d; } // Paper - OBFHELPER
protected gnu.trove.map.hash.TObjectIntHashMap<Class> entityCount = new gnu.trove.map.hash.TObjectIntHashMap<Class>(); // Spigot
// Paper start
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 15814f66..c7af8da6 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -299,6 +299,7 @@ public class ChunkProviderServer implements IChunkProvider {
if (chunk != null && chunk.d) {
// CraftBukkit start - move unload logic to own method
+ chunk.setShouldUnload(false); // Paper
if (!unloadChunk(chunk, true)) {
continue;
}
--
2.14.3