Fix block updates (and add support for neighboring blocks)

This commit is contained in:
RednedEpic 2019-10-09 20:03:18 -05:00 committed by RednedEpic
parent a125967ec3
commit 2da7709cd1
2 changed files with 6 additions and 4 deletions

View file

@ -21,8 +21,9 @@ public class JavaBlockChangeTranslator extends PacketTranslator<ServerBlockChang
record.getPosition().getY(),
record.getPosition().getZ()));
BlockEntry bedrockItem = TranslatorsInit.getBlockTranslator().getBedrockBlock(record.getBlock());
updateBlockPacket.setRuntimeId(GlobalBlockPalette.getOrCreateRuntimeId(bedrockItem.hashCode()));
BlockEntry itemEntry = TranslatorsInit.getBlockTranslator().getBedrockBlock(record.getBlock());
updateBlockPacket.setRuntimeId(GlobalBlockPalette.getOrCreateRuntimeId(itemEntry.getBedrockId() << 4 | itemEntry.getBedrockData()));
updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.NEIGHBORS);
session.getUpstream().sendPacket(updateBlockPacket);
}

View file

@ -47,8 +47,9 @@ public class JavaMultiBlockChangeTranslator extends PacketTranslator<ServerMulti
record.getPosition().getY(),
record.getPosition().getZ()));
BlockEntry bedrockItem = TranslatorsInit.getBlockTranslator().getBedrockBlock(record.getBlock());
updateBlockPacket.setRuntimeId(GlobalBlockPalette.getOrCreateRuntimeId(bedrockItem.hashCode()));
BlockEntry blockEntry = TranslatorsInit.getBlockTranslator().getBedrockBlock(record.getBlock());
updateBlockPacket.setRuntimeId(GlobalBlockPalette.getOrCreateRuntimeId(blockEntry.getBedrockId() << 4 | blockEntry.getBedrockData()));
updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.NEIGHBORS);
session.getUpstream().sendPacket(updateBlockPacket);
}