mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 21:17:53 +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
|
||||
@ -49,6 +53,19 @@ public class PlayerAbilitiesPacket implements ServerPacket {
|
||||
public void removeFlag(byte flag) {
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user