2011-07-17 00:19:25 +02:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
import java.util.List;
|
2011-07-17 00:19:25 +02:00
|
|
|
|
|
|
|
// CraftBukkit start
|
2011-09-30 09:28:23 +02:00
|
|
|
import org.bukkit.craftbukkit.block.CraftBlock;
|
2011-07-17 00:19:25 +02:00
|
|
|
import org.bukkit.event.block.BlockPistonRetractEvent;
|
|
|
|
import org.bukkit.event.block.BlockPistonExtendEvent;
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
public class BlockPiston extends Block {
|
|
|
|
|
|
|
|
private boolean a;
|
|
|
|
|
|
|
|
public BlockPiston(int i, int j, boolean flag) {
|
|
|
|
super(i, j, Material.PISTON);
|
|
|
|
this.a = flag;
|
|
|
|
this.a(h);
|
|
|
|
this.c(0.5F);
|
2012-07-29 09:33:13 +02:00
|
|
|
this.a(CreativeModeTab.d);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public int a(int i, int j) {
|
2012-07-29 09:33:13 +02:00
|
|
|
int k = e(j);
|
2011-07-17 00:19:25 +02:00
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
return k > 5 ? this.textureId : (i == k ? (!f(j) && this.minX <= 0.0D && this.minY <= 0.0D && this.minZ <= 0.0D && this.maxX >= 1.0D && this.maxY >= 1.0D && this.maxZ >= 1.0D ? this.textureId : 110) : (i == Facing.OPPOSITE_FACING[k] ? 109 : 108));
|
2011-11-20 09:01:14 +01:00
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
public int d() {
|
2011-11-20 09:01:14 +01:00
|
|
|
return 16;
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
public boolean c() {
|
2011-07-17 00:19:25 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
|
2011-07-17 00:19:25 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) {
|
2012-07-29 09:33:13 +02:00
|
|
|
int l = b(world, i, j, k, (EntityHuman) entityliving);
|
2011-07-17 00:19:25 +02:00
|
|
|
|
|
|
|
world.setData(i, j, k, l);
|
2012-07-29 09:33:13 +02:00
|
|
|
if (!world.isStatic) {
|
|
|
|
this.l(world, i, j, k);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void doPhysics(World world, int i, int j, int k, int l) {
|
2012-07-29 09:33:13 +02:00
|
|
|
if (!world.isStatic) {
|
|
|
|
this.l(world, i, j, k);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-28 07:59:59 +01:00
|
|
|
public void onPlace(World world, int i, int j, int k) {
|
2012-07-29 09:33:13 +02:00
|
|
|
if (!world.isStatic && world.getTileEntity(i, j, k) == null) {
|
2012-08-08 09:42:18 +02:00
|
|
|
this.l(world, i, j, k);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
private void l(World world, int i, int j, int k) {
|
2011-07-17 00:19:25 +02:00
|
|
|
int l = world.getData(i, j, k);
|
2012-07-29 09:33:13 +02:00
|
|
|
int i1 = e(l);
|
2011-07-17 00:19:25 +02:00
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
if (i1 != 7) {
|
2012-10-25 05:53:23 +02:00
|
|
|
boolean flag = this.d(world, i, j, k, i1);
|
2012-07-29 09:33:13 +02:00
|
|
|
|
|
|
|
if (flag && !f(l)) {
|
2011-07-17 00:19:25 +02:00
|
|
|
// CraftBukkit start
|
2012-11-06 13:05:28 +01:00
|
|
|
int length = i(world, i, j, k, i1);
|
2011-07-17 00:19:25 +02:00
|
|
|
if (length >= 0) {
|
|
|
|
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
|
2011-09-30 09:28:23 +02:00
|
|
|
BlockPistonExtendEvent event = new BlockPistonExtendEvent(block, length, CraftBlock.notchToBlockFace(i1));
|
2011-07-17 00:19:25 +02:00
|
|
|
world.getServer().getPluginManager().callEvent(event);
|
|
|
|
|
|
|
|
if (event.isCancelled()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
world.playNote(i, j, k, this.id, 0, i1);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
2012-07-29 09:33:13 +02:00
|
|
|
} else if (!flag && f(l)) {
|
2011-07-17 00:19:25 +02:00
|
|
|
// CraftBukkit start
|
|
|
|
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
|
2011-09-30 09:28:23 +02:00
|
|
|
BlockPistonRetractEvent event = new BlockPistonRetractEvent(block, CraftBlock.notchToBlockFace(i1));
|
2011-07-17 00:19:25 +02:00
|
|
|
world.getServer().getPluginManager().callEvent(event);
|
|
|
|
|
|
|
|
if (event.isCancelled()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
world.playNote(i, j, k, this.id, 1, i1);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
private boolean d(World world, int i, int j, int k, int l) {
|
2011-07-17 00:19:25 +02:00
|
|
|
return l != 0 && world.isBlockFaceIndirectlyPowered(i, j - 1, k, 0) ? true : (l != 1 && world.isBlockFaceIndirectlyPowered(i, j + 1, k, 1) ? true : (l != 2 && world.isBlockFaceIndirectlyPowered(i, j, k - 1, 2) ? true : (l != 3 && world.isBlockFaceIndirectlyPowered(i, j, k + 1, 3) ? true : (l != 5 && world.isBlockFaceIndirectlyPowered(i + 1, j, k, 5) ? true : (l != 4 && world.isBlockFaceIndirectlyPowered(i - 1, j, k, 4) ? true : (world.isBlockFaceIndirectlyPowered(i, j, k, 0) ? true : (world.isBlockFaceIndirectlyPowered(i, j + 2, k, 1) ? true : (world.isBlockFaceIndirectlyPowered(i, j + 1, k - 1, 2) ? true : (world.isBlockFaceIndirectlyPowered(i, j + 1, k + 1, 3) ? true : (world.isBlockFaceIndirectlyPowered(i - 1, j + 1, k, 4) ? true : world.isBlockFaceIndirectlyPowered(i + 1, j + 1, k, 5)))))))))));
|
|
|
|
}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public void b(World world, int i, int j, int k, int l, int i1) {
|
2011-07-17 00:19:25 +02:00
|
|
|
if (l == 0) {
|
2012-07-29 09:33:13 +02:00
|
|
|
world.setRawData(i, j, k, i1 | 8);
|
|
|
|
} else {
|
|
|
|
world.setRawData(i, j, k, i1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (l == 0) {
|
2012-11-06 13:05:28 +01:00
|
|
|
if (this.j(world, i, j, k, i1)) {
|
2011-07-17 00:19:25 +02:00
|
|
|
world.setData(i, j, k, i1 | 8);
|
|
|
|
world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "tile.piston.out", 0.5F, world.random.nextFloat() * 0.25F + 0.6F);
|
2011-11-20 09:01:14 +01:00
|
|
|
} else {
|
|
|
|
world.setRawData(i, j, k, i1);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
} else if (l == 1) {
|
2011-11-30 00:17:43 +01:00
|
|
|
TileEntity tileentity = world.getTileEntity(i + Facing.b[i1], j + Facing.c[i1], k + Facing.d[i1]);
|
2011-07-17 00:19:25 +02:00
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
if (tileentity instanceof TileEntityPiston) {
|
2012-10-25 05:53:23 +02:00
|
|
|
((TileEntityPiston) tileentity).f();
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
world.setRawTypeIdAndData(i, j, k, Block.PISTON_MOVING.id, i1);
|
|
|
|
world.setTileEntity(i, j, k, BlockPistonMoving.a(this.id, i1, i1, false, true));
|
|
|
|
if (this.a) {
|
2011-11-30 00:17:43 +01:00
|
|
|
int j1 = i + Facing.b[i1] * 2;
|
|
|
|
int k1 = j + Facing.c[i1] * 2;
|
|
|
|
int l1 = k + Facing.d[i1] * 2;
|
2011-07-17 00:19:25 +02:00
|
|
|
int i2 = world.getTypeId(j1, k1, l1);
|
|
|
|
int j2 = world.getData(j1, k1, l1);
|
|
|
|
boolean flag = false;
|
|
|
|
|
|
|
|
if (i2 == Block.PISTON_MOVING.id) {
|
|
|
|
TileEntity tileentity1 = world.getTileEntity(j1, k1, l1);
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
if (tileentity1 instanceof TileEntityPiston) {
|
2011-07-17 00:19:25 +02:00
|
|
|
TileEntityPiston tileentitypiston = (TileEntityPiston) tileentity1;
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
if (tileentitypiston.c() == i1 && tileentitypiston.b()) {
|
2012-10-25 05:53:23 +02:00
|
|
|
tileentitypiston.f();
|
2012-07-29 09:33:13 +02:00
|
|
|
i2 = tileentitypiston.a();
|
2012-10-25 05:53:23 +02:00
|
|
|
j2 = tileentitypiston.p();
|
2011-07-17 00:19:25 +02:00
|
|
|
flag = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
if (!flag && i2 > 0 && a(i2, world, j1, k1, l1, false) && (Block.byId[i2].q_() == 0 || i2 == Block.PISTON.id || i2 == Block.PISTON_STICKY.id)) {
|
2011-11-30 00:17:43 +01:00
|
|
|
i += Facing.b[i1];
|
|
|
|
j += Facing.c[i1];
|
|
|
|
k += Facing.d[i1];
|
2011-07-17 00:19:25 +02:00
|
|
|
world.setRawTypeIdAndData(i, j, k, Block.PISTON_MOVING.id, j2);
|
|
|
|
world.setTileEntity(i, j, k, BlockPistonMoving.a(i2, j2, i1, false, false));
|
2011-11-20 09:01:14 +01:00
|
|
|
world.setTypeId(j1, k1, l1, 0);
|
2011-07-17 00:19:25 +02:00
|
|
|
} else if (!flag) {
|
2011-11-30 00:17:43 +01:00
|
|
|
world.setTypeId(i + Facing.b[i1], j + Facing.c[i1], k + Facing.d[i1], 0);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
} else {
|
2011-11-30 00:17:43 +01:00
|
|
|
world.setTypeId(i + Facing.b[i1], j + Facing.c[i1], k + Facing.d[i1], 0);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "tile.piston.in", 0.5F, world.random.nextFloat() * 0.15F + 0.6F);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-30 00:17:43 +01:00
|
|
|
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
|
2011-07-17 00:19:25 +02:00
|
|
|
int l = iblockaccess.getData(i, j, k);
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
if (f(l)) {
|
|
|
|
switch (e(l)) {
|
2011-07-17 00:19:25 +02:00
|
|
|
case 0:
|
|
|
|
this.a(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
this.a(0.0F, 0.0F, 0.25F, 1.0F, 1.0F, 1.0F);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.75F);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
this.a(0.25F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
this.a(0.0F, 0.0F, 0.0F, 0.75F, 1.0F, 1.0F);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-20 09:01:14 +01:00
|
|
|
public void f() {
|
|
|
|
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
|
|
|
}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List list, Entity entity) {
|
2011-07-17 00:19:25 +02:00
|
|
|
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
2012-07-29 09:33:13 +02:00
|
|
|
super.a(world, i, j, k, axisalignedbb, list, entity);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
|
2012-03-01 11:49:23 +01:00
|
|
|
public AxisAlignedBB e(World world, int i, int j, int k) {
|
|
|
|
this.updateShape(world, i, j, k);
|
|
|
|
return super.e(world, i, j, k);
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
public boolean b() {
|
2011-07-17 00:19:25 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public static int e(int i) {
|
2012-02-29 22:31:04 +01:00
|
|
|
if ((i & 7) >= Facing.OPPOSITE_FACING.length) return 0; // CraftBukkit - check for AIOOB on piston data
|
2011-07-17 00:19:25 +02:00
|
|
|
return i & 7;
|
|
|
|
}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public static boolean f(int i) {
|
2011-07-17 00:19:25 +02:00
|
|
|
return (i & 8) != 0;
|
|
|
|
}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public static int b(World world, int i, int j, int k, EntityHuman entityhuman) {
|
2011-07-17 00:19:25 +02:00
|
|
|
if (MathHelper.abs((float) entityhuman.locX - (float) i) < 2.0F && MathHelper.abs((float) entityhuman.locZ - (float) k) < 2.0F) {
|
|
|
|
double d0 = entityhuman.locY + 1.82D - (double) entityhuman.height;
|
|
|
|
|
|
|
|
if (d0 - (double) j > 2.0D) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((double) j - d0 > 0.0D) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int l = MathHelper.floor((double) (entityhuman.yaw * 4.0F / 360.0F) + 0.5D) & 3;
|
|
|
|
|
|
|
|
return l == 0 ? 2 : (l == 1 ? 5 : (l == 2 ? 3 : (l == 3 ? 4 : 0)));
|
|
|
|
}
|
|
|
|
|
|
|
|
private static boolean a(int i, World world, int j, int k, int l, boolean flag) {
|
|
|
|
if (i == Block.OBSIDIAN.id) {
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
if (i != Block.PISTON.id && i != Block.PISTON_STICKY.id) {
|
2012-07-29 09:33:13 +02:00
|
|
|
if (Block.byId[i].m(world, j, k, l) == -1.0F) {
|
2011-07-17 00:19:25 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
if (Block.byId[i].q_() == 2) {
|
2011-07-17 00:19:25 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
if (!flag && Block.byId[i].q_() == 1) {
|
2011-07-17 00:19:25 +02:00
|
|
|
return false;
|
|
|
|
}
|
2012-07-29 09:33:13 +02:00
|
|
|
} else if (f(world.getData(j, k, l))) {
|
2011-07-17 00:19:25 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-11-20 09:01:14 +01:00
|
|
|
return !(Block.byId[i] instanceof BlockContainer);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
// CraftBukkit - boolean -> int return
|
2012-11-06 13:05:28 +01:00
|
|
|
private static int i(World world, int i, int j, int k, int l) {
|
2011-11-30 00:17:43 +01:00
|
|
|
int i1 = i + Facing.b[l];
|
|
|
|
int j1 = j + Facing.c[l];
|
|
|
|
int k1 = k + Facing.d[l];
|
2011-07-17 00:19:25 +02:00
|
|
|
int l1 = 0;
|
|
|
|
|
2011-09-15 02:23:52 +02:00
|
|
|
while (true) {
|
|
|
|
if (l1 < 13) {
|
2012-03-01 11:49:23 +01:00
|
|
|
if (j1 <= 0 || j1 >= 255) {
|
2011-11-20 09:01:14 +01:00
|
|
|
return -1; // CraftBukkit
|
|
|
|
}
|
|
|
|
|
|
|
|
int i2 = world.getTypeId(i1, j1, k1);
|
|
|
|
|
|
|
|
if (i2 != 0) {
|
|
|
|
if (!a(i2, world, i1, j1, k1, true)) {
|
|
|
|
return -1; // CraftBukkit
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
if (Block.byId[i2].q_() != 1) {
|
2011-11-20 09:01:14 +01:00
|
|
|
if (l1 == 12) {
|
|
|
|
return -1; // CraftBukkit
|
2011-09-15 02:23:52 +02:00
|
|
|
}
|
|
|
|
|
2011-11-30 00:17:43 +01:00
|
|
|
i1 += Facing.b[l];
|
|
|
|
j1 += Facing.c[l];
|
|
|
|
k1 += Facing.d[l];
|
2011-11-20 09:01:14 +01:00
|
|
|
++l1;
|
|
|
|
continue;
|
2011-09-15 02:23:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return l1; // CraftBukkit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
private boolean j(World world, int i, int j, int k, int l) {
|
2011-11-30 00:17:43 +01:00
|
|
|
int i1 = i + Facing.b[l];
|
|
|
|
int j1 = j + Facing.c[l];
|
|
|
|
int k1 = k + Facing.d[l];
|
2011-07-17 00:19:25 +02:00
|
|
|
int l1 = 0;
|
|
|
|
|
|
|
|
while (true) {
|
|
|
|
int i2;
|
|
|
|
|
|
|
|
if (l1 < 13) {
|
2012-03-01 11:49:23 +01:00
|
|
|
if (j1 <= 0 || j1 >= 255) {
|
2011-11-20 09:01:14 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
i2 = world.getTypeId(i1, j1, k1);
|
|
|
|
if (i2 != 0) {
|
|
|
|
if (!a(i2, world, i1, j1, k1, true)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
if (Block.byId[i2].q_() != 1) {
|
2011-11-20 09:01:14 +01:00
|
|
|
if (l1 == 12) {
|
|
|
|
return false;
|
2011-09-16 21:10:11 +02:00
|
|
|
}
|
2011-11-20 09:01:14 +01:00
|
|
|
|
2011-11-30 00:17:43 +01:00
|
|
|
i1 += Facing.b[l];
|
|
|
|
j1 += Facing.c[l];
|
|
|
|
k1 += Facing.d[l];
|
2011-11-20 09:01:14 +01:00
|
|
|
++l1;
|
|
|
|
continue;
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
Block.byId[i2].c(world, i1, j1, k1, world.getData(i1, j1, k1), 0);
|
2011-11-20 09:01:14 +01:00
|
|
|
world.setTypeId(i1, j1, k1, 0);
|
2011-07-17 00:19:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
while (i1 != i || j1 != j || k1 != k) {
|
2011-11-30 00:17:43 +01:00
|
|
|
l1 = i1 - Facing.b[l];
|
|
|
|
i2 = j1 - Facing.c[l];
|
|
|
|
int j2 = k1 - Facing.d[l];
|
2011-07-17 00:19:25 +02:00
|
|
|
int k2 = world.getTypeId(l1, i2, j2);
|
|
|
|
int l2 = world.getData(l1, i2, j2);
|
|
|
|
|
|
|
|
if (k2 == this.id && l1 == i && i2 == j && j2 == k) {
|
2012-07-29 09:33:13 +02:00
|
|
|
world.setRawTypeIdAndData(i1, j1, k1, Block.PISTON_MOVING.id, l | (this.a ? 8 : 0), false);
|
2011-07-17 00:19:25 +02:00
|
|
|
world.setTileEntity(i1, j1, k1, BlockPistonMoving.a(Block.PISTON_EXTENSION.id, l | (this.a ? 8 : 0), l, true, false));
|
|
|
|
} else {
|
2012-07-29 09:33:13 +02:00
|
|
|
world.setRawTypeIdAndData(i1, j1, k1, Block.PISTON_MOVING.id, l2, false);
|
2011-07-17 00:19:25 +02:00
|
|
|
world.setTileEntity(i1, j1, k1, BlockPistonMoving.a(k2, l2, l, true, false));
|
|
|
|
}
|
|
|
|
|
|
|
|
i1 = l1;
|
|
|
|
j1 = i2;
|
|
|
|
k1 = j2;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|