Search in sources :

Example 1 with IEjectAnimator

use of com.bluepowermod.tile.IEjectAnimator in project BluePower by Qmunity.

the class BlockContainerBase method getIcon.

@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
    if (textures == null)
        return super.getIcon(world, x, y, z, side);
    TileEntity te = get(world, x, y, z);
    RendererBlockBase.EnumFaceType faceType = EnumFaceType.SIDE;
    boolean powered = false;
    boolean ejecting = false;
    if (te instanceof IRotatable) {
        ForgeDirection rotation = ((IRotatable) te).getFacingDirection();
        if (rotation.ordinal() == side)
            faceType = EnumFaceType.FRONT;
        if (rotation.getOpposite().ordinal() == side)
            faceType = EnumFaceType.BACK;
    }
    if (te instanceof IBluePowered) {
        powered = ((IBluePowered) te).isPowered();
    }
    if (te instanceof IEjectAnimator) {
        ejecting = ((IEjectAnimator) te).isEjecting();
    }
    return getIcon(faceType, ejecting, powered, side, te);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) EnumFaceType(com.bluepowermod.client.render.RendererBlockBase.EnumFaceType) IBluePowered(com.bluepowermod.tile.IBluePowered) IRotatable(com.bluepowermod.tile.IRotatable) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) IEjectAnimator(com.bluepowermod.tile.IEjectAnimator) RendererBlockBase(com.bluepowermod.client.render.RendererBlockBase) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

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 IRotatable (com.bluepowermod.tile.IRotatable)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 TileEntity (net.minecraft.tileentity.TileEntity)1 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)1