use of cpw.mods.fml.relauncher.SideOnly 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);
}
use of cpw.mods.fml.relauncher.SideOnly in project BluePower by Qmunity.
the class BlockContainerBase method registerBlockIcons.
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
textures = new HashMap<String, IIcon>();
for (EnumFaceType faceType : EnumFaceType.values()) {
boolean ejecting = false;
boolean powered = false;
do {
do {
String iconName = getIconName(faceType, ejecting, powered);
if (!textures.containsKey(iconName)) {
textures.put(iconName, iconRegister.registerIcon(iconName));
}
powered = !powered;
} while (powered && IBluePowered.class.isAssignableFrom(getTileEntity()));
ejecting = !ejecting;
} while (ejecting && IEjectAnimator.class.isAssignableFrom(getTileEntity()));
}
}
use of cpw.mods.fml.relauncher.SideOnly in project BluePower by Qmunity.
the class BlockCPU method getIcon.
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
TileCPU tile = (TileCPU) world.getTileEntity(x, y, z);
ForgeDirection dir = tile.getFacingDirection();
if (dir.ordinal() == side) {
return frontTexture;
} else if (dir.getOpposite().ordinal() == side) {
return backTexture;
} else if (ForgeDirection.UP.ordinal() == side) {
return topTexture;
} else if (ForgeDirection.DOWN.ordinal() == side) {
return bottomTexture;
} else {
return sideTexture;
}
}
use of cpw.mods.fml.relauncher.SideOnly in project BluePower by Qmunity.
the class BlockMonitor method getIcon.
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
TileMonitor tile = (TileMonitor) world.getTileEntity(x, y, z);
ForgeDirection dir = tile.getFacingDirection();
if (dir.ordinal() == side) {
return frontTexture;
} else if (dir.getOpposite().ordinal() == side) {
return backTexture;
} else if (ForgeDirection.UP.ordinal() == side) {
return topTexture;
} else if (ForgeDirection.DOWN.ordinal() == side) {
return bottomTexture;
} else {
return sideTexture;
}
}
use of cpw.mods.fml.relauncher.SideOnly in project BluePower by Qmunity.
the class BlockAlloyFurnace method getIcon.
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
TileAlloyFurnace te = (TileAlloyFurnace) world.getTileEntity(x, y, z);
ForgeDirection forgeSide = ForgeDirection.getOrientation(side);
if (forgeSide == ForgeDirection.UP)
return textureTop;
if (forgeSide == ForgeDirection.DOWN)
return textureBottom;
if (forgeSide == te.getFacingDirection())
return te.getIsActive() ? textureFrontOn : textureFrontOff;
return textureSide;
}
Aggregations