mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-24 18:07:39 +01:00
Added PlayerAbilities for diff visibility.
This commit is contained in:
parent
5a6878b9b1
commit
adebd466fb
32
src/main/java/net/minecraft/server/PlayerAbilities.java
Normal file
32
src/main/java/net/minecraft/server/PlayerAbilities.java
Normal file
@ -0,0 +1,32 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
public class PlayerAbilities {
|
||||
|
||||
public boolean isInvulnerable = false;
|
||||
public boolean isFlying = false;
|
||||
public boolean canFly = false;
|
||||
public boolean canInstantlyBuild = false;
|
||||
|
||||
public PlayerAbilities() {}
|
||||
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
|
||||
nbttagcompound1.setBoolean("invulnerable", this.isInvulnerable);
|
||||
nbttagcompound1.setBoolean("flying", this.isInvulnerable);
|
||||
nbttagcompound1.setBoolean("mayfly", this.canFly);
|
||||
nbttagcompound1.setBoolean("instabuild", this.canInstantlyBuild);
|
||||
nbttagcompound.set("abilities", nbttagcompound1);
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
if (nbttagcompound.hasKey("abilities")) {
|
||||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("abilities");
|
||||
|
||||
this.isInvulnerable = nbttagcompound1.getBoolean("invulnerable");
|
||||
this.isFlying = nbttagcompound1.getBoolean("flying");
|
||||
this.canFly = nbttagcompound1.getBoolean("mayfly");
|
||||
this.canInstantlyBuild = nbttagcompound1.getBoolean("instabuild");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user