SPIGOT-4563: Fix regenerating chunks saved to disk already

This commit is contained in:
md_5
2019-01-03 15:44:06 +11:00
parent 917411fd80
commit d0a9130d24
2 changed files with 28 additions and 19 deletions

View File

@@ -21,7 +21,7 @@
this.batchScheduler = new SchedulerBatch<>(this.chunkScheduler);
}
@@ -112,6 +117,22 @@
@@ -112,6 +117,25 @@
}
}
@@ -31,10 +31,13 @@
+ this.batchScheduler.b();
+ ChunkCoordIntPair pos = new ChunkCoordIntPair(x, z);
+ this.chunkScheduler.forcePolluteCache(pos);
+ ((ChunkRegionLoader) this.chunkLoader).blacklist.add(pos.a());
+ this.batchScheduler.a(pos);
+ CompletableFuture<ProtoChunk> completablefuture = this.batchScheduler.c();
+
+ return (Chunk) completablefuture.thenApply(this::a).join();
+ Chunk chunk = (Chunk) completablefuture.thenApply(this::a).join();
+ ((ChunkRegionLoader) this.chunkLoader).blacklist.remove(pos.a());
+ return chunk;
+ } catch (RuntimeException runtimeexception) {
+ throw this.a(x, z, (Throwable) runtimeexception);
+ }
@@ -44,7 +47,7 @@
public IChunkAccess a(int i, int j, boolean flag) {
Chunk chunk = this.getChunkAt(i, j, true, false);
@@ -249,10 +270,12 @@
@@ -249,10 +273,12 @@
Chunk chunk = (Chunk) this.chunks.get(olong);
if (chunk != null) {
@@ -61,7 +64,7 @@
++i;
}
}
@@ -265,6 +288,42 @@
@@ -265,6 +291,42 @@
return false;
}