From 8447e4f3edbd76a07b53da249d11a1ce7af42c7a Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 2 Mar 2016 21:27:49 +0000 Subject: [PATCH] SPIGOT-1659: Fix a mistake in ChunkProviderServer that sometimes caused recursive chunk loads --- nms-patches/ChunkProviderServer.patch | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/nms-patches/ChunkProviderServer.patch b/nms-patches/ChunkProviderServer.patch index 6c5d4e2595..cb45aa3b06 100644 --- a/nms-patches/ChunkProviderServer.patch +++ b/nms-patches/ChunkProviderServer.patch @@ -98,7 +98,7 @@ return chunk; } -@@ -61,20 +86,66 @@ +@@ -61,20 +86,67 @@ Chunk chunk = this.getLoadedChunkAt(i, j); if (chunk == null) { @@ -127,6 +127,7 @@ } public Chunk getChunkAt(int i, int j) { +- Chunk chunk = this.getOrLoadChunkAt(i, j); + return getChunkAt(i, j, null); + } + @@ -160,13 +161,14 @@ + } + + public Chunk originalGetChunkAt(int i, int j) { - Chunk chunk = this.getOrLoadChunkAt(i, j); ++ this.unloadQueue.remove(i, j); ++ Chunk chunk = this.chunks.get(LongHash.toLong(i, j)); + boolean newChunk = false; + // CraftBukkit end if (chunk == null) { long k = ChunkCoordIntPair.a(i, j); -@@ -92,11 +163,38 @@ +@@ -92,11 +164,38 @@ crashreportsystemdetails.a("Generator", (Object) this.chunkGenerator); throw new ReportedException(crashreport); } @@ -207,7 +209,7 @@ chunk.loadNearby(this, this.chunkGenerator); } -@@ -142,10 +240,12 @@ +@@ -142,10 +241,12 @@ public boolean a(boolean flag) { int i = 0; @@ -223,7 +225,7 @@ if (flag) { this.saveChunkNOP(chunk); -@@ -170,22 +270,43 @@ +@@ -170,22 +271,43 @@ public boolean unloadChunks() { if (!this.world.savingDisabled) { @@ -274,7 +276,7 @@ this.chunkLoader.a(); } -@@ -198,7 +319,8 @@ +@@ -198,7 +320,8 @@ } public String getName() { @@ -284,7 +286,7 @@ } public List a(EnumCreatureType enumcreaturetype, BlockPosition blockposition) { -@@ -210,10 +332,11 @@ +@@ -210,10 +333,11 @@ } public int g() {