diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-05-26 13:48:22 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-05-26 13:48:22 +0100 |
commit | 6903f2024217f0959c015e76b23297af8e3b573f (patch) | |
tree | 690bf275ce19c655bd64eea05be231ed0c318fd6 /src/main/java/net/minecraft/server/BlockButton.java | |
parent | f463453d73249fe73cf3e23ed37e6cee870c8bf4 (diff) | |
download | craftbukkit-6903f2024217f0959c015e76b23297af8e3b573f.tar craftbukkit-6903f2024217f0959c015e76b23297af8e3b573f.tar.gz craftbukkit-6903f2024217f0959c015e76b23297af8e3b573f.tar.lz craftbukkit-6903f2024217f0959c015e76b23297af8e3b573f.tar.xz craftbukkit-6903f2024217f0959c015e76b23297af8e3b573f.zip |
Implemented 1.6!
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockButton.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockButton.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/BlockButton.java b/src/main/java/net/minecraft/server/BlockButton.java index 3a36bb9d..883e340a 100644 --- a/src/main/java/net/minecraft/server/BlockButton.java +++ b/src/main/java/net/minecraft/server/BlockButton.java @@ -20,7 +20,7 @@ public class BlockButton extends Block { return null; } - public int b() { + public int c() { return 20; } @@ -28,6 +28,14 @@ public class BlockButton extends Block { return false; } + public boolean b() { + return false; + } + + public boolean canPlace(World world, int i, int j, int k, int l) { + return l == 2 && world.d(i, j, k + 1) ? true : (l == 3 && world.d(i, j, k - 1) ? true : (l == 4 && world.d(i + 1, j, k) ? true : l == 5 && world.d(i - 1, j, k))); + } + public boolean canPlace(World world, int i, int j, int k) { return world.d(i - 1, j, k) ? true : (world.d(i + 1, j, k) ? true : (world.d(i, j, k - 1) ? true : world.d(i, j, k + 1))); } @@ -78,7 +86,7 @@ public class BlockButton extends Block { } if (flag) { - this.a_(world, i, j, k, world.getData(i, j, k)); + this.b_(world, i, j, k, world.getData(i, j, k)); world.setTypeId(i, j, k, 0); } } @@ -86,7 +94,7 @@ public class BlockButton extends Block { private boolean h(World world, int i, int j, int k) { if (!this.canPlace(world, i, j, k)) { - this.a_(world, i, j, k, world.getData(i, j, k)); + this.b_(world, i, j, k, world.getData(i, j, k)); world.setTypeId(i, j, k, 0); return false; } else { @@ -160,7 +168,7 @@ public class BlockButton extends Block { world.applyPhysics(i, j - 1, k, this.id); } - world.c(i, j, k, this.id, this.b()); + world.c(i, j, k, this.id, this.c()); return true; } } @@ -188,7 +196,7 @@ public class BlockButton extends Block { super.remove(world, i, j, k); } - public boolean b(IBlockAccess iblockaccess, int i, int j, int k, int l) { + public boolean a(IBlockAccess iblockaccess, int i, int j, int k, int l) { return (iblockaccess.getData(i, j, k) & 8) > 0; } |