3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 04:50:05 +01:00

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

Dieser Commit ist enthalten in:
Travis Watkins 2013-12-02 20:12:42 -06:00
Ursprung 8c444f275a
Commit c5d8b4393a

Datei anzeigen

@ -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