Block break supported. Ignore the exceptions

This commit is contained in:
EOT3000 2019-09-27 17:38:52 -04:00
parent 3d986c47fa
commit 792adb3447
2 changed files with 13 additions and 0 deletions

View file

@ -90,6 +90,18 @@ public class BedrockActionTranslator extends PacketTranslator<PlayerActionPacket
Hand.MAIN_HAND, 0, 0, 0, false);
session.getDownstream().getSession().send(blockPacket);
case START_BREAK:
ClientPlayerActionPacket actionPacket = new ClientPlayerActionPacket(PlayerAction.START_DIGGING, position, BlockFace.values()[packet.getFace()]);
session.getDownstream().getSession().send(actionPacket);
case ABORT_BREAK:
ClientPlayerActionPacket actionPacket2 = new ClientPlayerActionPacket(PlayerAction.CANCEL_DIGGING, position, BlockFace.values()[packet.getFace()]);
session.getDownstream().getSession().send(actionPacket2);
case STOP_BREAK:
ClientPlayerActionPacket actionPacket3 = new ClientPlayerActionPacket(PlayerAction.FINISH_DIGGING, position, BlockFace.values()[packet.getFace()]);
session.getDownstream().getSession().send(actionPacket3);
}
}
}

View file

@ -37,6 +37,7 @@ public class JavaJoinGameTranslator extends PacketTranslator<ServerJoinGamePacke
public void translate(ServerJoinGamePacket packet, GeyserSession session) {
AdventureSettingsPacket bedrockPacket = new AdventureSettingsPacket();
bedrockPacket.setUniqueEntityId(session.getPlayerEntity().getGeyserId());
bedrockPacket.setPlayerPermission(1);
session.getUpstream().sendPacketImmediately(bedrockPacket);
PlayStatusPacket playStatus = new PlayStatusPacket();