Fix possible NPE in 1.17->1.16.4 bedrock at 0 emulation (#821)

This commit is contained in:
EnZaXD 2024-07-14 10:10:03 +02:00 committed by GitHub
parent 7e08534f4f
commit c9d57aab8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -364,6 +364,7 @@ public final class BlockItemPacketRewriter1_17 extends BackwardsItemRewriter<Cli
if (ViaBackwards.getConfig().bedrockAtY0()) {
final ChunkSection lowestSection = chunk.getSections()[0];
if (lowestSection != null) {
final DataPalette blocks = lowestSection.palette(PaletteType.BLOCKS);
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
@ -371,6 +372,7 @@ public final class BlockItemPacketRewriter1_17 extends BackwardsItemRewriter<Cli
}
}
}
}
chunk.getBlockEntities().removeIf(compound -> {
NumberTag tag = compound.getNumberTag("y");