use static fields in Player

This commit is contained in:
MrGazdag 2021-07-27 12:08:13 +02:00 committed by GitHub
parent a6c6944e56
commit 5b1e06de04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1787,13 +1787,13 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
protected void refreshAbilities() { protected void refreshAbilities() {
byte flags = 0; byte flags = 0;
if (invulnerable) if (invulnerable)
flags |= 0x01; flags |= PlayerAbilitiesPacket.FLAG_INVULNERABLE;
if (flying) if (flying)
flags |= 0x02; flags |= PlayerAbilitiesPacket.FLAG_FLYING;
if (allowFlying) if (allowFlying)
flags |= 0x04; flags |= PlayerAbilitiesPacket.FLAG_ALLOW_FLYING;
if (instantBreak) if (instantBreak)
flags |= 0x08; flags |= PlayerAbilitiesPacket.FLAG_INSTANT_BREAK;
playerConnection.sendPacket(new PlayerAbilitiesPacket(flags, flyingSpeed, fieldViewModifier)); playerConnection.sendPacket(new PlayerAbilitiesPacket(flags, flyingSpeed, fieldViewModifier));
} }