Search in sources :

Example 6 with IRotatable

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;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IRotatable(com.bluepowermod.tile.IRotatable) ForgeDirection(net.minecraftforge.common.util.ForgeDirection)

Aggregations

IRotatable (com.bluepowermod.tile.IRotatable)6 TileEntity (net.minecraft.tileentity.TileEntity)5 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)4 SideOnly (cpw.mods.fml.relauncher.SideOnly)2 RendererBlockBase (com.bluepowermod.client.render.RendererBlockBase)1 EnumFaceType (com.bluepowermod.client.render.RendererBlockBase.EnumFaceType)1 IBluePowered (com.bluepowermod.tile.IBluePowered)1 IEjectAnimator (com.bluepowermod.tile.IEjectAnimator)1 Block (net.minecraft.block.Block)1