diff --git a/src/main/java/net/minestom/server/entity/Player.java b/src/main/java/net/minestom/server/entity/Player.java index 2bd400e02..d0350d542 100644 --- a/src/main/java/net/minestom/server/entity/Player.java +++ b/src/main/java/net/minestom/server/entity/Player.java @@ -1787,13 +1787,13 @@ public class Player extends LivingEntity implements CommandSender, Localizable, protected void refreshAbilities() { byte flags = 0; if (invulnerable) - flags |= 0x01; + flags |= PlayerAbilitiesPacket.FLAG_INVULNERABLE; if (flying) - flags |= 0x02; + flags |= PlayerAbilitiesPacket.FLAG_FLYING; if (allowFlying) - flags |= 0x04; + flags |= PlayerAbilitiesPacket.FLAG_ALLOW_FLYING; if (instantBreak) - flags |= 0x08; + flags |= PlayerAbilitiesPacket.FLAG_INSTANT_BREAK; playerConnection.sendPacket(new PlayerAbilitiesPacket(flags, flyingSpeed, fieldViewModifier)); } diff --git a/src/main/java/net/minestom/server/network/packet/server/play/PlayerAbilitiesPacket.java b/src/main/java/net/minestom/server/network/packet/server/play/PlayerAbilitiesPacket.java index 23b2d278e..4035c86ad 100644 --- a/src/main/java/net/minestom/server/network/packet/server/play/PlayerAbilitiesPacket.java +++ b/src/main/java/net/minestom/server/network/packet/server/play/PlayerAbilitiesPacket.java @@ -7,6 +7,10 @@ import net.minestom.server.utils.binary.BinaryWriter; import org.jetbrains.annotations.NotNull; public class PlayerAbilitiesPacket implements ServerPacket { + public static final byte FLAG_INVULNERABLE = 0x01; + public static final byte FLAG_FLYING = 0x02; + public static final byte FLAG_ALLOW_FLYING = 0x04; + public static final byte FLAG_INSTANT_BREAK = 0x08; public byte flags; public float flyingSpeed;