aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0134-Fix-Chunk-Unload-Queue-Issues.patch
blob: 46f7ff0678c87872525149fc0d0105947708f8de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 5f497d51aadf17988eb23ce59d233324b3628047 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 3db29161d..98f2cff15 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 54b454fe3..57ae50d2e 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.12.0.windows.1