aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0153-Unmark-chunk-as-unloading-when-unload-is-cancelled.patch
blob: 01534369f726adb20b9c5623bdb6fa3b5a419a5e (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
From 5a965808414b88283da8dc7aa36f9dcb6090311f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 12 May 2016 02:03:56 -0400
Subject: [PATCH] Unmark chunk as unloading when unload is cancelled


diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index d7b9581..40d4c9c 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -47,7 +47,7 @@ public class Chunk {
     private long w;
     private int x;
     private ConcurrentLinkedQueue<BlockPosition> y;
-    public boolean d;
+    public boolean d;public void setShouldUnload(boolean unload) { this.d = unload; } // 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 c2c6d3a..7427e6e 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -303,6 +303,7 @@ public class ChunkProviderServer implements IChunkProvider {
                     Chunk chunk = (Chunk) this.chunks.get(olong);
 
                     if (chunk != null && chunk.d) {
+                        chunk.setShouldUnload(false); // Paper
                         // CraftBukkit start
                         ChunkUnloadEvent event = new ChunkUnloadEvent(chunk.bukkitChunk);
                         this.world.getServer().getPluginManager().callEvent(event);
-- 
2.8.2