mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-06 00:17:58 +01:00
Make it clear that PlayerAbilitiesPacket uses a bitmask
This commit is contained in:
parent
2da42cb8cb
commit
d219570fe6
@ -22,13 +22,13 @@ public class PlayerAbilitiesPacket implements ServerPacket {
|
||||
public void write(@NotNull BinaryWriter writer) {
|
||||
byte flags = 0;
|
||||
if (invulnerable)
|
||||
flags += 1;
|
||||
flags |= 0x01;
|
||||
if (flying)
|
||||
flags += 2;
|
||||
flags |= 0x02;
|
||||
if (allowFlying)
|
||||
flags += 4;
|
||||
flags |= 0x04;
|
||||
if (instantBreak)
|
||||
flags += 8;
|
||||
flags |= 0x08;
|
||||
|
||||
writer.writeByte(flags);
|
||||
writer.writeFloat(flyingSpeed);
|
||||
|
Loading…
Reference in New Issue
Block a user