refresh pose on gamemode change (#1888)

This commit is contained in:
tahmid-23 2024-02-28 12:54:12 -05:00 committed by GitHub
parent 2947279898
commit aad7bdab0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1589,13 +1589,21 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
this.allowFlying = true;
this.instantBreak = false;
this.invulnerable = true;
this.flying = true;
if (isActive()) {
refreshFlying(true);
} else {
this.flying = true;
}
}
default -> {
this.allowFlying = false;
this.instantBreak = false;
this.invulnerable = false;
this.flying = false;
if (isActive()) {
refreshFlying(false);
} else {
this.flying = false;
}
}
}
// Make sure that the player is in the PLAY state and synchronize their flight speed.