Fix World#isChunkGenerated calls (#2186)

* Fix World#isChunkGenerated calls

Optimize World#loadChunk() too
This patch also adds a chunk status cache on region files (note that
its only purpose is to cache the status on DISK)

* Ensure correct regionfile usage

This also bumps the minimum region file cache to 4 files given
readChunkData can load potentially 4 files.

* Fix closed check

* Better checks for invalid regionfile usage
This commit is contained in:
Spottedleaf
2019-06-16 20:52:34 -07:00
parent ee46fa7483
commit bf2043b339
4 changed files with 351 additions and 4 deletions

View File

@@ -160,6 +160,19 @@ index c973ab6076..30701fd7f3 100644
+ return this.blockIds.a(iblockdata); // Paper - decompile fix
}
}
diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java
index 26db8f135f..dd1822d6ff 100644
--- a/src/main/java/net/minecraft/server/ChunkStatus.java
+++ b/src/main/java/net/minecraft/server/ChunkStatus.java
@@ -0,0 +0,0 @@ public class ChunkStatus {
return (CompletableFuture) function.apply(ichunkaccess);
});
private static final List<ChunkStatus> q = ImmutableList.of(ChunkStatus.FULL, ChunkStatus.FEATURES, ChunkStatus.LIQUID_CARVERS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS);
- private static final IntList r = (IntList) SystemUtils.a((Object) (new IntArrayList(a().size())), (intarraylist) -> {
+ private static final IntList r = (IntList) SystemUtils.a((new IntArrayList(a().size())), (java.util.function.Consumer<IntArrayList>)(IntArrayList intarraylist) -> { // Paper - decompile fix
int i = 0;
for (int j = a().size() - 1; j >= 0; --j) {
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
index a79262631c..5184e52626 100644
--- a/src/main/java/net/minecraft/server/EntityFox.java