use of cpw.mods.fml.relauncher.SideOnly in project BluePower by Qmunity.
the class BlockProjectTable method getIcon.
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
IRotatable rotatable = (IRotatable) world.getTileEntity(x, y, z);
ForgeDirection s = ForgeDirection.getOrientation(side);
if (rotatable.getFacingDirection() == s) {
return textureFront;
}
switch(s) {
case UP:
return textureTop;
case DOWN:
return textureBottom;
case EAST:
case NORTH:
case SOUTH:
case WEST:
case UNKNOWN:
return textureSide;
default:
break;
}
return null;
}
use of cpw.mods.fml.relauncher.SideOnly in project BluePower by Qmunity.
the class ItemDamageableColorableOverlay method getSubItems.
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item par1, CreativeTabs tab, List subItems) {
subItems.add(new ItemStack(this, 1, 16));
super.getSubItems(par1, tab, subItems);
}
use of cpw.mods.fml.relauncher.SideOnly in project BluePower by Qmunity.
the class ItemPart method addInformation.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack item, EntityPlayer player, List list, boolean unused) {
BPPart part = PartManager.getExample(item);
if (part == null)
return;
List<String> l = new ArrayList<String>();
part.addTooltip(item, l);
list.addAll(l);
}
use of cpw.mods.fml.relauncher.SideOnly in project BluePower by Qmunity.
the class GateIntegratedCircuit method renderStatic.
// Rendering
@Override
@SideOnly(Side.CLIENT)
public boolean renderStatic(Vec3i translation, RenderHelper renderer, RenderBlocks renderBlocks, int pass) {
switch(getFace()) {
case DOWN:
break;
case UP:
renderer.addTransformation(new Rotation(180, 180, 0, Vec3d.center));
break;
case NORTH:
renderer.addTransformation(new Rotation(90, 0, 0, Vec3d.center));
break;
case SOUTH:
renderer.addTransformation(new Rotation(-90, 0, 0, Vec3d.center));
break;
case WEST:
renderer.addTransformation(new Rotation(0, 0, -90, Vec3d.center));
break;
case EAST:
renderer.addTransformation(new Rotation(0, 0, 90, Vec3d.center));
break;
default:
break;
}
int rotation = getRotation();
if (rotation != -1)
renderer.addTransformation(new Rotation(0, 90 * -rotation, 0));
IIcon[] icons = new IIcon[] { getIcon(ForgeDirection.DOWN), getIcon(ForgeDirection.UP), getIcon(ForgeDirection.WEST), getIcon(ForgeDirection.EAST), getIcon(ForgeDirection.NORTH), getIcon(ForgeDirection.SOUTH) };
renderer.renderBox(new Vec3dCube(0, 0, 0, 1, 1 / 16D, 1), icons);
renderer.renderBox(new Vec3dCube(0, 1 / 16D, 0, 1, 2 / 16D, 1 / 16D), icons);
renderer.renderBox(new Vec3dCube(0, 1 / 16D, 15 / 16D, 1, 2 / 16D, 1), icons);
renderer.renderBox(new Vec3dCube(0, 1 / 16D, 0, 1 / 16D, 2 / 16D, 1), icons);
renderer.renderBox(new Vec3dCube(15 / 16D, 1 / 16D, 0, 1, 2 / 16D, 1), icons);
for (IGateComponent c : getComponents()) c.renderStatic(translation, renderer, pass);
double scale = (1 - border * 2D) / getSize();
renderer.addTransformation(new Scale(scale, scale, scale));
for (int x = 0; x < getSize(); x++) {
for (int z = 0; z < getSize(); z++) {
IIntegratedCircuitPart part = getPart(x, z);
if (part == null)
continue;
int s = getSize();
if (s % 2 == 1)
s -= 1;
double a = (getSize() - 1) / 2D;
renderer.addTransformation(new Translation(-(s - x - a), -a, -(s - z - a)));
part.renderStatic(translation, renderer, renderBlocks, pass);
renderer.addTransformation(new Translation(s - x - a, a, s - z - a));
}
}
renderer.removeTransformation();
return true;
}
use of cpw.mods.fml.relauncher.SideOnly in project BluePower by Qmunity.
the class GateNullCell method renderStatic.
// Rendering
@Override
@SideOnly(Side.CLIENT)
public boolean renderStatic(Vec3i translation, RenderHelper renderer, RenderBlocks renderBlocks, int pass) {
super.renderStatic(translation, renderer, renderBlocks, pass);
double height = 2 / 16D;
IIcon wire = IconSupplier.wire;
if (typeA != null) {
// Flat
renderer.setColor(WireHelper.getColorForPowerLevel(typeA, powerA));
ForgeDirection dir = ForgeDirection.NORTH;
for (int i = 0; i < getRotation(); i++) dir = dir.getRotation(getFace().getOpposite());
dir = new Vec3d(0, 0, 0).add(dir).rotateUndo(getFace(), Vec3d.center).toForgeDirection();
renderer.renderBox(new Vec3dCube(7 / 16D, 2 / 16D, 1 / 16D, 9 / 16D, 2 / 16D + height, 15 / 16D), wire);
renderer.renderBox(new Vec3dCube(7 / 16D, 2 / 16D, 0 / 16D, 9 / 16D, 2 / 16D + (height / (nullcells[dir.ordinal()] ? 1 : 2)), 1 / 16D), wire);
renderer.renderBox(new Vec3dCube(7 / 16D, 2 / 16D, 15 / 16D, 9 / 16D, 2 / 16D + (height / (nullcells[dir.getOpposite().ordinal()] ? 1 : 2)), 16 / 16D), wire);
}
if (typeB != null) {
// Supported
renderer.setColor(WireHelper.getColorForPowerLevel(typeB, powerB));
ForgeDirection dir = ForgeDirection.WEST;
for (int i = 0; i < getRotation(); i++) dir = dir.getRotation(getFace().getOpposite());
dir = new Vec3d(0, 0, 0).add(dir).rotateUndo(getFace(), Vec3d.center).toForgeDirection();
if (!nullcells[dir.ordinal()])
renderer.renderBox(new Vec3dCube(0 / 16D, 2 / 16D, 7 / 16D, 2 / 16D, 10 / 16D, 9 / 16D), wire);
if (!nullcells[dir.getOpposite().ordinal()])
renderer.renderBox(new Vec3dCube(14 / 16D, 2 / 16D, 7 / 16D, 16 / 16D, 10 / 16D, 9 / 16D), wire);
renderer.renderBox(new Vec3dCube(0 / 16D, 10 / 16D, 7 / 16D, 16 / 16D, 12 / 16D, 9 / 16D), wire);
}
renderer.setColor(0xFFFFFF);
renderer.resetTransformations();
return true;
}
Aggregations