mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 21:19:00 +01:00
Use correct packet data for toggling flying. Fixes BUKKIT-4989
This commit is contained in:
parent
8c444f275a
commit
c5d8b4393a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user