mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 21:17:53 +01:00
Merge pull request #381 from MrGazdag/patch-7
Add 'addFlag' and 'removeFlag' to PlayerAbilitiesPacket
This commit is contained in:
commit
2e406e5c46
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user