mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-10 21:00:36 +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) {
|
public void write(@NotNull BinaryWriter writer) {
|
||||||
byte flags = 0;
|
byte flags = 0;
|
||||||
if (invulnerable)
|
if (invulnerable)
|
||||||
flags += 1;
|
flags |= 0x01;
|
||||||
if (flying)
|
if (flying)
|
||||||
flags += 2;
|
flags |= 0x02;
|
||||||
if (allowFlying)
|
if (allowFlying)
|
||||||
flags += 4;
|
flags |= 0x04;
|
||||||
if (instantBreak)
|
if (instantBreak)
|
||||||
flags += 8;
|
flags |= 0x08;
|
||||||
|
|
||||||
writer.writeByte(flags);
|
writer.writeByte(flags);
|
||||||
writer.writeFloat(flyingSpeed);
|
writer.writeFloat(flyingSpeed);
|
||||||
|
Loading…
Reference in New Issue
Block a user