Don't validate chunk before it's been run through DataConverter (#7907)

This commit is contained in:
Noah van der Aa 2022-06-09 18:39:02 +02:00 committed by GitHub
parent a3a0390e3b
commit 84434e6ae9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1396,7 +1396,7 @@ index 0000000000000000000000000000000000000000..f1b940704400266e6df186139b57ec72
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..aaf73da45e6ba6e990a94f63eb3da0e250153053 index 0000000000000000000000000000000000000000..e9070b6158e7e8c2dd33a9dcb20898a2f0d86e48
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java
@@ -0,0 +1,148 @@ @@ -0,0 +1,148 @@
@ -1487,12 +1487,6 @@ index 0000000000000000000000000000000000000000..aaf73da45e6ba6e990a94f63eb3da0e2
+ return; + return;
+ } + }
+ +
+ if (!ChunkMap.isChunkDataValid(chunkData.chunkData)) {
+ LOGGER.error("Chunk file at {} is missing level data, skipping", new ChunkPos(this.chunkX, this.chunkZ));
+ this.complete(ChunkLoadTask.createEmptyHolder());
+ return;
+ }
+
+ final ChunkPos chunkPos = new ChunkPos(this.chunkX, this.chunkZ); + final ChunkPos chunkPos = new ChunkPos(this.chunkX, this.chunkZ);
+ +
+ final ChunkMap chunkManager = this.world.getChunkSource().chunkMap; + final ChunkMap chunkManager = this.world.getChunkSource().chunkMap;
@ -1511,6 +1505,12 @@ index 0000000000000000000000000000000000000000..aaf73da45e6ba6e990a94f63eb3da0e2
+ return; + return;
+ } + }
+ +
+ if (!ChunkMap.isChunkDataValid(chunkData.chunkData)) {
+ LOGGER.error("Chunk file at {} is missing level data, skipping", new ChunkPos(this.chunkX, this.chunkZ));
+ this.complete(ChunkLoadTask.createEmptyHolder());
+ return;
+ }
+
+ if (this.checkCancelled()) { + if (this.checkCancelled()) {
+ return; + return;
+ } + }