use of com.bluepowermod.tile.IRotatable in project BluePower by Qmunity.
the class BlockContainerBase method rotateBlock.
@Override
public boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis) {
TileEntity te = get(worldObj, x, y, z);
if (te instanceof IRotatable) {
IRotatable rotatable = (IRotatable) te;
ForgeDirection dir = rotatable.getFacingDirection();
dir = dir.getRotation(axis);
if (dir != ForgeDirection.UP && dir != ForgeDirection.DOWN || canRotateVertical()) {
rotatable.setFacingDirection(dir);
return true;
}
}
return false;
}
Aggregations