mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 22:47:49 +01:00
Made Player#setPermissionLevel persistent after death.
This commit is contained in:
parent
66681c5caf
commit
6eac7282af
@ -150,7 +150,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
|
|
||||||
private BelowNameTag belowNameTag;
|
private BelowNameTag belowNameTag;
|
||||||
|
|
||||||
private int permissionLevel;
|
private byte permissionLevel;
|
||||||
|
|
||||||
private boolean reducedDebugScreenInformation;
|
private boolean reducedDebugScreenInformation;
|
||||||
|
|
||||||
@ -418,6 +418,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
getPlayerConnection().sendPacket(respawnPacket);
|
getPlayerConnection().sendPacket(respawnPacket);
|
||||||
PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(this);
|
PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(this);
|
||||||
EventDispatcher.call(respawnEvent);
|
EventDispatcher.call(respawnEvent);
|
||||||
|
triggerStatus((byte) (24 + permissionLevel)); // Set permission level
|
||||||
refreshIsDead(false);
|
refreshIsDead(false);
|
||||||
|
|
||||||
// Runnable called when teleportation is successful (after loading and sending necessary chunk)
|
// Runnable called when teleportation is successful (after loading and sending necessary chunk)
|
||||||
@ -1590,7 +1591,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
public void setPermissionLevel(int permissionLevel) {
|
public void setPermissionLevel(int permissionLevel) {
|
||||||
Check.argCondition(!MathUtils.isBetween(permissionLevel, 0, 4), "permissionLevel has to be between 0 and 4");
|
Check.argCondition(!MathUtils.isBetween(permissionLevel, 0, 4), "permissionLevel has to be between 0 and 4");
|
||||||
|
|
||||||
this.permissionLevel = permissionLevel;
|
this.permissionLevel = (byte) permissionLevel;
|
||||||
|
|
||||||
// Magic values: https://wiki.vg/Entity_statuses#Player
|
// Magic values: https://wiki.vg/Entity_statuses#Player
|
||||||
// TODO remove magic values
|
// TODO remove magic values
|
||||||
|
Loading…
Reference in New Issue
Block a user