mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-25 17:01:45 +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) {
|
public void a(PacketPlayInAbilities packetplayinabilities) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start - d() should be isFlying()
|
||||||
if (this.player.abilities.canFly && this.player.abilities.isFlying != packetplayinabilities.f()) {
|
if (this.player.abilities.canFly && this.player.abilities.isFlying != packetplayinabilities.d()) {
|
||||||
PlayerToggleFlightEvent event = new PlayerToggleFlightEvent(this.server.getPlayer(this.player), packetplayinabilities.f());
|
PlayerToggleFlightEvent event = new PlayerToggleFlightEvent(this.server.getPlayer(this.player), packetplayinabilities.f());
|
||||||
this.server.getPluginManager().callEvent(event);
|
this.server.getPluginManager().callEvent(event);
|
||||||
if (!event.isCancelled()) {
|
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 {
|
else {
|
||||||
this.player.updateAbilities(); // Tell the player their ability was reverted
|
this.player.updateAbilities(); // Tell the player their ability was reverted
|
||||||
|
Loading…
Reference in New Issue
Block a user