diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-15 01:23:52 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-15 01:23:52 +0100 |
commit | 5b2c774edc069f70d1fa9940d96bb0b8705bef7a (patch) | |
tree | 79d1800e7154bba7b5fca4f8c8373ee4376cca89 /src/main/java/net/minecraft/server/BlockPiston.java | |
parent | 54bcd1c1f36691a714234e5ca2f30a20b3ad2816 (diff) | |
download | craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar.gz craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar.lz craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar.xz craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.zip |
Update for Minecraft 1.8
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockPiston.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockPiston.java | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java index 1c27571a..a6423ed8 100644 --- a/src/main/java/net/minecraft/server/BlockPiston.java +++ b/src/main/java/net/minecraft/server/BlockPiston.java @@ -48,7 +48,7 @@ public class BlockPiston extends Block { } } - public void c(World world, int i, int j, int k) { + public void a(World world, int i, int j, int k) { if (!world.isStatic && world.getTileEntity(i, j, k) == null) { this.g(world, i, j, k); } @@ -110,7 +110,7 @@ public class BlockPiston extends Block { TileEntity tileentity = world.getTileEntity(i + PistonBlockTextures.b[i1], j + PistonBlockTextures.c[i1], k + PistonBlockTextures.d[i1]); if (tileentity != null && tileentity instanceof TileEntityPiston) { - ((TileEntityPiston) tileentity).k(); + ((TileEntityPiston) tileentity).e(); } world.setRawTypeIdAndData(i, j, k, Block.PISTON_MOVING.id, i1); @@ -130,9 +130,9 @@ public class BlockPiston extends Block { TileEntityPiston tileentitypiston = (TileEntityPiston) tileentity1; if (tileentitypiston.d() == i1 && tileentitypiston.c()) { - tileentitypiston.k(); + tileentitypiston.e(); i2 = tileentitypiston.a(); - j2 = tileentitypiston.e(); + j2 = tileentitypiston.j(); flag = true; } } @@ -296,6 +296,48 @@ public class BlockPiston extends Block { } } + private static int H(World world, int i, int j, int k, int l) { + int i1 = i + PistonBlockTextures.b[l]; + int j1 = j + PistonBlockTextures.c[l]; + int k1 = k + PistonBlockTextures.d[l]; + int l1 = 0; + + while (true) { + if (l1 < 13) { + if (j1 > 0) { + world.getClass(); + if (j1 < 128 - 1) { + int i2 = world.getTypeId(i1, j1, k1); + + if (i2 != 0) { + if (!a(i2, world, i1, j1, k1, true)) { + return -1; // CraftBukkit + } + + if (Block.byId[i2].e() != 1) { + if (l1 == 12) { + return -1; // CraftBukkit + } + + i1 += PistonBlockTextures.b[l]; + j1 += PistonBlockTextures.c[l]; + k1 += PistonBlockTextures.d[l]; + ++l1; + continue; + } + } + + return l1; // CraftBukkit + } + } + + return -1; // CraftBukkit + } + + return l1; // CraftBukkit + } + } + private boolean i(World world, int i, int j, int k, int l) { int i1 = i + PistonBlockTextures.b[l]; int j1 = j + PistonBlockTextures.c[l]; |