forked from GeyserMC/Geyser
Fix block updates (and add support for neighboring blocks)
This commit is contained in:
parent
a125967ec3
commit
2da7709cd1
2 changed files with 6 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue