From 9a1b86730dd7bbfe1d665274487a2860c8525d0f Mon Sep 17 00:00:00 2001 From: Sergey Shatunov Date: Mon, 1 Feb 2016 23:16:31 +0700 Subject: [PATCH] Avoid to load chunks if block updated scheduled in unloaded chunk --- patches/net/minecraft/world/WorldServer.java.patch | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/patches/net/minecraft/world/WorldServer.java.patch b/patches/net/minecraft/world/WorldServer.java.patch index 95cbf65..f1d4d54 100644 --- a/patches/net/minecraft/world/WorldServer.java.patch +++ b/patches/net/minecraft/world/WorldServer.java.patch @@ -423,11 +423,21 @@ } this.theProfiler.startSection("cleaning"); -@@ -523,6 +714,7 @@ +@@ -515,14 +706,15 @@ + for (int j = 0; j < i; ++j) + { + nextticklistentry = (NextTickListEntry)this.pendingTickListEntriesTreeSet.first(); +- +- if (!p_72955_1_ && nextticklistentry.scheduledTime > this.worldInfo.getWorldTotalTime()) ++ Chunk chunk = getChunkIfLoaded(nextticklistentry.xCoord >> 4, nextticklistentry.zCoord >> 4); ++ if (!p_72955_1_ && (nextticklistentry.scheduledTime > this.worldInfo.getWorldTotalTime() || chunk == null)) + { + break; + } this.pendingTickListEntriesTreeSet.remove(nextticklistentry); this.pendingTickListEntriesHashSet.remove(nextticklistentry); -+ getChunkFromBlockCoords(nextticklistentry.xCoord, nextticklistentry.zCoord).blockUpdates.remove(nextticklistentry); // KCauldron ++ chunk.blockUpdates.remove(nextticklistentry); // KCauldron this.pendingTickListEntriesThisTick.add(nextticklistentry); }