if(block == Blocks.piston_extension) {
int meta = getBlockMetaAt(s);
boolean sticky = (meta & 8) == 8;
ForgeDirection dir = ForgeDirection.getOrientation(meta & ~8);
MinecraftServer server = MinecraftServer.getServer();
if(server != null && getTimeInCoords(s) == 0) {
String newPos;
{
String[] tokens = s.split(":");
int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]);
World world = server.worldServerForDimension(worldId);
world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, ModBlocks.pistonRelay);
newPos = getCoordsAsString(world.provider.dimensionId, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
}
if(mappedPositions.containsKey(s)) {
String pos = mappedPositions.get(s);
String[] tokens = pos.split(":");
int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]);
World world = server.worldServerForDimension(worldId);
Block srcBlock = world.getBlock(x, y, z);
int srcMeta = world.getBlockMetadata(x, y, z);
TileEntity tile = world.getTileEntity(x, y, z);
Material mat = srcBlock.getMaterial();