Fix reading the wrong block if palette only has one entry
This commit is contained in:
parent
3243c0c36e
commit
faa6965df3
|
@ -194,6 +194,7 @@ public class ChunkAnvil113 extends MCAChunk {
|
|||
}
|
||||
|
||||
public BlockState getBlockState(int x, int y, int z) {
|
||||
if (palette.length == 1) return palette[0];
|
||||
if (blocks.length == 0) return BlockState.AIR;
|
||||
|
||||
x &= 0xF; y &= 0xF; z &= 0xF; // Math.floorMod(pos.getX(), 16)
|
||||
|
|
|
@ -196,6 +196,7 @@ public class ChunkAnvil115 extends MCAChunk {
|
|||
}
|
||||
|
||||
public BlockState getBlockState(int x, int y, int z) {
|
||||
if (palette.length == 1) return palette[0];
|
||||
if (blocks.length == 0) return BlockState.AIR;
|
||||
|
||||
x &= 0xF; y &= 0xF; z &= 0xF; // Math.floorMod(pos.getX(), 16)
|
||||
|
|
|
@ -230,8 +230,8 @@ public class ChunkAnvil116 extends MCAChunk {
|
|||
}
|
||||
|
||||
public BlockState getBlockState(int x, int y, int z) {
|
||||
if (blocks.length == 0) return BlockState.AIR;
|
||||
if (palette.length == 1) return palette[0];
|
||||
if (blocks.length == 0) return BlockState.AIR;
|
||||
|
||||
x &= 0xF; y &= 0xF; z &= 0xF; // Math.floorMod(pos.getX(), 16)
|
||||
|
||||
|
|
|
@ -231,8 +231,8 @@ public class ChunkAnvil118 extends MCAChunk {
|
|||
}
|
||||
|
||||
public BlockState getBlockState(int x, int y, int z) {
|
||||
if (blocks.length == 0) return BlockState.AIR;
|
||||
if (blockPalette.length == 1) return blockPalette[0];
|
||||
if (blocks.length == 0) return BlockState.AIR;
|
||||
|
||||
x &= 0xF; y &= 0xF; z &= 0xF; // Math.floorMod(pos.getX(), 16)
|
||||
|
||||
|
|
Loading…
Reference in New Issue