mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-05 18:32:28 +01:00
Fixed Player#isFlying it is now properly synchronized with the client
This commit is contained in:
parent
ae53cca19d
commit
f8ff01349b
@ -1118,10 +1118,14 @@ public class Player extends LivingEntity {
|
|||||||
* @param flying should the player fly
|
* @param flying should the player fly
|
||||||
*/
|
*/
|
||||||
public void setFlying(boolean flying) {
|
public void setFlying(boolean flying) {
|
||||||
this.flying = flying;
|
refreshFlying(flying);
|
||||||
refreshAbilities();
|
refreshAbilities();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void refreshFlying(boolean flying) {
|
||||||
|
this.flying = flying;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the player if allowed to fly, false otherwise
|
* @return true if the player if allowed to fly, false otherwise
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,7 @@ public class AbilitiesListener {
|
|||||||
|
|
||||||
if (canFly) {
|
if (canFly) {
|
||||||
boolean isFlying = (packet.flags & 0x2) > 0;
|
boolean isFlying = (packet.flags & 0x2) > 0;
|
||||||
|
player.refreshFlying(isFlying);
|
||||||
|
|
||||||
if (isFlying) {
|
if (isFlying) {
|
||||||
PlayerStartFlyingEvent startFlyingEvent = new PlayerStartFlyingEvent(player);
|
PlayerStartFlyingEvent startFlyingEvent = new PlayerStartFlyingEvent(player);
|
||||||
|
Loading…
Reference in New Issue
Block a user