Search in sources :

Example 6 with SideOnly

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;
}
Also used : IRotatable(com.bluepowermod.tile.IRotatable) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 7 with SideOnly

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);
}
Also used : ItemStack(net.minecraft.item.ItemStack) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 8 with SideOnly

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);
}
Also used : ArrayList(java.util.ArrayList) BPPart(com.bluepowermod.part.BPPart) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 9 with SideOnly

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;
}
Also used : Translation(uk.co.qmunity.lib.transform.Translation) IIcon(net.minecraft.util.IIcon) IGateComponent(com.bluepowermod.api.gate.IGateComponent) IIntegratedCircuitPart(com.bluepowermod.api.gate.IIntegratedCircuitPart) Scale(uk.co.qmunity.lib.transform.Scale) Rotation(uk.co.qmunity.lib.transform.Rotation) Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 10 with SideOnly

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;
}
Also used : IIcon(net.minecraft.util.IIcon) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) Vec3d(uk.co.qmunity.lib.vec.Vec3d) Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

SideOnly (cpw.mods.fml.relauncher.SideOnly)204 ItemStack (net.minecraft.item.ItemStack)52 IIcon (net.minecraft.util.IIcon)17 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)17 Vec3dCube (uk.co.qmunity.lib.vec.Vec3dCube)13 Block (net.minecraft.block.Block)12 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)10 TileEntity (net.minecraft.tileentity.TileEntity)10 AxisAlignedBB (net.minecraft.util.AxisAlignedBB)9 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)8 ArrayList (java.util.ArrayList)8 Rotation (uk.co.qmunity.lib.transform.Rotation)8 AMParticle (am2.particles.AMParticle)6 IconFlipped (net.minecraft.client.renderer.IconFlipped)6 ItemBlock (net.minecraft.item.ItemBlock)6 Minecraft (net.minecraft.client.Minecraft)5 Tessellator (net.minecraft.client.renderer.Tessellator)5 EntityPlayer (net.minecraft.entity.player.EntityPlayer)5 GuiScreen (net.minecraft.client.gui.GuiScreen)4 RenderHelper (uk.co.qmunity.lib.client.render.RenderHelper)4