summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-06-12 12:28:08 +1000
committermd_5 <git@md-5.net>2016-06-12 12:28:08 +1000
commit1f507256e79798f9e8e6a9114de4830bbdfa9bf3 (patch)
tree4dda5a1757c3260868248579afbe7a4349d037f8
parentf642d4bcc3ee5a6e29876a213544f4502cfc863c (diff)
downloadcraftbukkit-1f507256e79798f9e8e6a9114de4830bbdfa9bf3.tar
craftbukkit-1f507256e79798f9e8e6a9114de4830bbdfa9bf3.tar.gz
craftbukkit-1f507256e79798f9e8e6a9114de4830bbdfa9bf3.tar.lz
craftbukkit-1f507256e79798f9e8e6a9114de4830bbdfa9bf3.tar.xz
craftbukkit-1f507256e79798f9e8e6a9114de4830bbdfa9bf3.zip
SPIGOT-2322: Chunks generating with missing / corrupted data.
-rw-r--r--nms-patches/ChunkProviderServer.patch32
1 files changed, 18 insertions, 14 deletions
diff --git a/nms-patches/ChunkProviderServer.patch b/nms-patches/ChunkProviderServer.patch
index b5a6d413..f6fa24c8 100644
--- a/nms-patches/ChunkProviderServer.patch
+++ b/nms-patches/ChunkProviderServer.patch
@@ -13,11 +13,10 @@
public class ChunkProviderServer implements IChunkProvider {
private static final Logger a = LogManager.getLogger();
-@@ -69,19 +75,74 @@
+@@ -69,6 +75,26 @@
Chunk chunk = this.getLoadedChunkAt(i, j);
if (chunk == null) {
-- chunk = this.loadChunk(i, j);
+ // CraftBukkit start
+ ChunkRegionLoader loader = null;
+
@@ -27,16 +26,21 @@
+ if (loader != null && loader.chunkExists(world, i, j)) {
+ chunk = ChunkIOExecutor.syncChunkLoad(world, loader, this, i, j);
+ }
-+ /* chunk = this.loadChunk(i, j);
++ }
++
++ return chunk;
++ }
++
++ @Nullable
++ public Chunk originalGetOrLoadChunkAt(int i, int j) {
++ // CraftBukkit end
++ Chunk chunk = this.getLoadedChunkAt(i, j);
++
++ if (chunk == null) {
+ chunk = this.loadChunk(i, j);
if (chunk != null) {
this.chunks.put(ChunkCoordIntPair.a(i, j), chunk);
- chunk.addEntities();
- chunk.loadNearby(this, this.chunkGenerator);
- }
-+ */
-+ // CraftBukkit end
- }
-
+@@ -80,8 +106,52 @@
return chunk;
}
@@ -84,13 +88,13 @@
+ }
+
+ public Chunk originalGetChunkAt(int i, int j) {
-+ Chunk chunk = this.getLoadedChunkAt(i, j);
++ Chunk chunk = this.originalGetOrLoadChunkAt(i, j);
+ boolean newChunk = false;
+ // CraftBukkit end
if (chunk == null) {
long k = ChunkCoordIntPair.a(i, j);
-@@ -97,9 +158,37 @@
+@@ -97,9 +167,37 @@
crashreportsystemdetails.a("Generator", (Object) this.chunkGenerator);
throw new ReportedException(crashreport);
}
@@ -128,7 +132,7 @@
chunk.loadNearby(this, this.chunkGenerator);
}
-@@ -146,10 +235,12 @@
+@@ -146,10 +244,12 @@
public boolean a(boolean flag) {
int i = 0;
@@ -144,7 +148,7 @@
if (flag) {
this.saveChunkNOP(chunk);
-@@ -182,6 +273,29 @@
+@@ -182,6 +282,29 @@
Chunk chunk = (Chunk) this.chunks.get(olong);
if (chunk != null && chunk.d) {