use of org.valkyrienskies.mod.common.network.MessagePlayerStoppedPiloting in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class VSKeyHandler method playerTick.
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void playerTick(PlayerTickEvent event) {
if (event.side == Side.SERVER) {
return;
}
if (event.phase == Phase.START) {
IShipPilotClient clientPilot = (IShipPilotClient) event.player;
clientPilot.onClientTick();
if (dismountKey.isKeyDown() && clientPilot.isPilotingATile()) {
BlockPos pilotedPos = clientPilot.getPosBeingControlled();
MessagePlayerStoppedPiloting stopPilotingMessage = new MessagePlayerStoppedPiloting(pilotedPos);
ValkyrienSkiesMod.controlNetwork.sendToServer(stopPilotingMessage);
clientPilot.stopPilotingEverything();
}
if (dismountKey.isKeyDown() && clientPilot.getShipIDBeingControlled() != null) {
MessagePlayerStoppedPiloting stopPilotingMessage = new MessagePlayerStoppedPiloting(clientPilot.getShipIDBeingControlled());
ValkyrienSkiesMod.controlNetwork.sendToServer(stopPilotingMessage);
clientPilot.stopPilotingEverything();
}
}
}
Aggregations