@Override public boolean rotateBlock(World world, int x, int y, int z, ForgeDirection axis) { if (Arrays.asList(getRotationAxes()).contains(axis)) { TEBase TE = getTileEntity(world, x, y, z); if (TE != null && data.isFreestanding(TE)) { int side = data.getDirection(TE).ordinal() == data.DIR_ON_X ? data.DIR_ON_Z : data.DIR_ON_X; return data.setDirection(TE, ForgeDirection.getOrientation(side)); } } return super.rotateBlock(world, x, y, z, axis); }
@Override /** Called when the block is placed in the world. */ public void onBlockPlacedBy( World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack) { super.onBlockPlacedBy(world, x, y, z, entityLiving, itemStack); if (!entityLiving.isSneaking()) { // Copy type and direction of adjacent ladder type for (int side = 0; side < 2; ++side) { TEBase TE = getTileEntity(world, x, y, z); ForgeDirection dir = ForgeDirection.getOrientation(side); if (world.getBlock(x, y - dir.offsetY, z).equals(this)) { TEBase TE_adj = (TEBase) world.getTileEntity(x, y - dir.offsetY, z); data.setType(TE, data.getType(TE_adj)); data.setDirection(TE, data.getDirection(TE_adj)); } } } }