Fixed Player#isFlying it is now properly synchronized with the client

This commit is contained in:
Felix Cravic 2020-05-24 22:27:58 +02:00
parent ae53cca19d
commit f8ff01349b
2 changed files with 6 additions and 1 deletions

View File

@ -1118,10 +1118,14 @@ public class Player extends LivingEntity {
* @param flying should the player fly
*/
public void setFlying(boolean flying) {
this.flying = flying;
refreshFlying(flying);
refreshAbilities();
}
public void refreshFlying(boolean flying) {
this.flying = flying;
}
/**
* @return true if the player if allowed to fly, false otherwise
*/

View File

@ -12,6 +12,7 @@ public class AbilitiesListener {
if (canFly) {
boolean isFlying = (packet.flags & 0x2) > 0;
player.refreshFlying(isFlying);
if (isFlying) {
PlayerStartFlyingEvent startFlyingEvent = new PlayerStartFlyingEvent(player);