Fix chunk leak issue with queued light updates

This commit is contained in:
Aikar
2016-05-13 01:34:37 -04:00
parent f623f903cd
commit b6d0dd32c6
3 changed files with 38 additions and 20 deletions

View File

@@ -15,6 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+import org.bukkit.Location;
+
+import javax.annotation.Nullable;
+import java.util.regex.Pattern;
+
+public class MCUtil {
@@ -129,6 +130,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ final int modZ = pos.getZ() & 15;
+ return (modX == 0 || modX == 15 || modZ == 0 || modZ == 15);
+ }
+
+ /**
+ * Gets a chunk without changing its boolean for should unload
+ * @param world
+ * @param x
+ * @param z
+ * @return
+ */
+ @Nullable public static Chunk getLoadedChunkWithoutMarkingActive(World world, int x, int z) {
+ return ((ChunkProviderServer) world.chunkProvider).chunks.get(ChunkCoordIntPair.a(x, z));
+ }
+ /**
+ * Gets a chunk without changing its boolean for should unload
+ * @param provider
+ * @param x
+ * @param z
+ * @return
+ */
+ @Nullable public static Chunk getLoadedChunkWithoutMarkingActive(ChunkProviderServer provider, int x, int z) {
+ return provider.chunks.get(ChunkCoordIntPair.a(x, z));
+ }
+}
diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644