diff options
author | EvilSeph <evilseph@gmail.com> | 2012-03-15 04:54:59 -0400 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-15 04:54:59 -0400 |
commit | adebd466fb42530d5344947223a13936eb57e4b1 (patch) | |
tree | 3198523b54ced33c6311344d20987721878b8599 /src/main/java/net/minecraft/server/PlayerAbilities.java | |
parent | 5a6878b9b1f1be8158c5b10e705d2f69739f4bb2 (diff) | |
download | craftbukkit-adebd466fb42530d5344947223a13936eb57e4b1.tar craftbukkit-adebd466fb42530d5344947223a13936eb57e4b1.tar.gz craftbukkit-adebd466fb42530d5344947223a13936eb57e4b1.tar.lz craftbukkit-adebd466fb42530d5344947223a13936eb57e4b1.tar.xz craftbukkit-adebd466fb42530d5344947223a13936eb57e4b1.zip |
Added PlayerAbilities for diff visibility.
Diffstat (limited to 'src/main/java/net/minecraft/server/PlayerAbilities.java')
-rw-r--r-- | src/main/java/net/minecraft/server/PlayerAbilities.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerAbilities.java b/src/main/java/net/minecraft/server/PlayerAbilities.java new file mode 100644 index 00000000..41f9e0e1 --- /dev/null +++ b/src/main/java/net/minecraft/server/PlayerAbilities.java @@ -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"); + } + } +} |