2016-05-13 05:34:37 +00:00
|
|
|
From e5bd49a93687c1a4aed20c45b62283540017f6a0 Mon Sep 17 00:00:00 2001
|
2016-05-12 06:07:39 +00:00
|
|
|
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
|
2016-05-13 05:34:37 +00:00
|
|
|
index 1e172b8..f72b1f8 100644
|
2016-05-12 06:07:39 +00:00
|
|
|
--- 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 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
|
|
|
|
public int lightUpdates; // Paper - Number of queued light updates for this chunk
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
2016-05-13 05:34:37 +00:00
|
|
|
index 1bc001d..7820ad9 100644
|
2016-05-12 06:07:39 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
2016-05-13 05:34:37 +00:00
|
|
|
@@ -303,6 +303,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
2016-05-12 06:07:39 +00:00
|
|
|
Chunk chunk = (Chunk) this.chunks.get(olong);
|
|
|
|
|
|
|
|
if (chunk != null && chunk.d) {
|
|
|
|
+ chunk.setShouldUnload(false); // Paper
|
|
|
|
if (chunk.hasLightUpdates()) continue; // Paper - Don't unload chunks with pending light updates.
|
|
|
|
// CraftBukkit start
|
|
|
|
ChunkUnloadEvent event = new ChunkUnloadEvent(chunk.bukkitChunk);
|
|
|
|
--
|
|
|
|
2.8.2
|
|
|
|
|