use of net.glowstone.net.message.play.player.PlayerPositionLookMessage in project Dragonet-Legacy by DragonetMC.
the class MovePlayerPacketTranslator method handleSpecific.
@Override
public Message[] handleSpecific(MovePlayerPacket packet) {
Location loc = new Location(this.getSession().getPlayer().getWorld(), packet.x, packet.y, packet.z);
if (!this.getSession().validateMovement(loc)) {
//Revert
this.getSession().sendPosition();
System.out.println("Reverted movement! ");
return null;
}
//Hack ;P
((DragonetPlayer) this.getSession().getPlayer()).setLocation(new Location(((DragonetPlayer) this.getSession().getPlayer()).getWorld(), packet.x, packet.y, packet.z, packet.yaw, packet.pitch));
return new Message[] { new PlayerPositionLookMessage(false, (double) packet.x, (double) packet.y, (double) packet.z, packet.yaw, packet.pitch) };
}
Aggregations