mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
fix documentation and add hasFlag
This commit is contained in:
parent
5b1e06de04
commit
a20fb32ef5
@ -29,6 +29,8 @@ public class PlayerAbilitiesPacket implements ServerPacket {
|
||||
/**
|
||||
* Adds a flag to the 'flags' byte.
|
||||
*
|
||||
* @param flag the flag
|
||||
*
|
||||
* @see PlayerAbilitiesPacket#FLAG_INVULNERABLE
|
||||
* @see PlayerAbilitiesPacket#FLAG_FLYING
|
||||
* @see PlayerAbilitiesPacket#FLAG_ALLOW_FLYING
|
||||
@ -41,6 +43,8 @@ public class PlayerAbilitiesPacket implements ServerPacket {
|
||||
/**
|
||||
* Removes a flag from the 'flags' byte.
|
||||
*
|
||||
* @param flag the flag
|
||||
*
|
||||
* @see PlayerAbilitiesPacket#FLAG_INVULNERABLE
|
||||
* @see PlayerAbilitiesPacket#FLAG_FLYING
|
||||
* @see PlayerAbilitiesPacket#FLAG_ALLOW_FLYING
|
||||
@ -50,6 +54,19 @@ public class PlayerAbilitiesPacket implements ServerPacket {
|
||||
flags &= ~(flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param flag the flag
|
||||
* @returns true if the 'flags' byte contains the specified flag
|
||||
*
|
||||
* @see PlayerAbilitiesPacket#FLAG_INVULNERABLE
|
||||
* @see PlayerAbilitiesPacket#FLAG_FLYING
|
||||
* @see PlayerAbilitiesPacket#FLAG_ALLOW_FLYING
|
||||
* @see PlayerAbilitiesPacket#FLAG_INSTANT_BREAK
|
||||
*/
|
||||
public boolean hasFlag(byte flag) {
|
||||
return (flags & flag) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull BinaryWriter writer) {
|
||||
writer.writeByte(flags);
|
||||
|
Loading…
Reference in New Issue
Block a user