mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 04:02:06 -07:00
Fix NPE from using wrong ProtoChunk ctor (#6147)
This commit is contained in:
@@ -1190,13 +1190,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
return levelChunkSections[yIndex];
|
||||
}
|
||||
|
||||
+ net.minecraft.world.level.Level getLevel(); // Paper - Anti-Xray - Add parameters
|
||||
+
|
||||
Collection<Entry<Heightmap.Types, Heightmap>> getHeightmaps();
|
||||
|
||||
default void setHeightmap(Heightmap.Types type, long[] heightmap) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java
|
||||
@@ -1398,22 +1391,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
int j = data.length * 64 / 4096;
|
||||
if (this.palette == this.globalPalette) {
|
||||
Palette<T> palette = new HashMapPalette<>(this.registry, i, this.dummyPaletteResize, this.reader, this.writer);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||
@@ -0,0 +0,0 @@ public class ProtoChunk implements ChunkAccess {
|
||||
public int getHeight() {
|
||||
return this.levelHeightAccessor.getHeight();
|
||||
}
|
||||
+
|
||||
+ // Paper start - Anti-Xray - Add parameters
|
||||
+ @Override
|
||||
+ public net.minecraft.world.level.Level getLevel() {
|
||||
+ return level;
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
|
||||
|
Reference in New Issue
Block a user