Use correct packet data for toggling flying. Fixes BUKKIT-4989

This commit is contained in:
Travis Watkins 2013-12-02 20:12:42 -06:00
parent 8c444f275a
commit c5d8b4393a

View File

@ -1584,12 +1584,12 @@ public class PlayerConnection implements PacketPlayInListener {
}
public void a(PacketPlayInAbilities packetplayinabilities) {
// CraftBukkit start
if (this.player.abilities.canFly && this.player.abilities.isFlying != packetplayinabilities.f()) {
// CraftBukkit start - d() should be isFlying()
if (this.player.abilities.canFly && this.player.abilities.isFlying != packetplayinabilities.d()) {
PlayerToggleFlightEvent event = new PlayerToggleFlightEvent(this.server.getPlayer(this.player), packetplayinabilities.f());
this.server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.player.abilities.isFlying = packetplayinabilities.f(); // Actually set the player's flying status
this.player.abilities.isFlying = packetplayinabilities.d(); // Actually set the player's flying status
}
else {
this.player.updateAbilities(); // Tell the player their ability was reverted