Search in sources :

Example 1 with GateComponentSiliconChip

use of com.bluepowermod.part.gate.component.GateComponentSiliconChip in project BluePower by Qmunity.

the class GateSynchronizer method initComponents.

@Override
public void initComponents() {
    addComponent(t = new GateComponentTorch(this, 0xffb400, 5 / 16D, true));
    addComponent(w1 = new GateComponentWire(this, 0x208800, RedwireType.BLUESTONE).setPower((byte) 255));
    addComponent(w2 = new GateComponentWire(this, 0x3faa62, RedwireType.BLUESTONE).setPower((byte) 255));
    addComponent(w3 = new GateComponentWire(this, 0xa50d7f, RedwireType.BLUESTONE));
    addComponent(new GateComponentWire(this, 0xFFF600, RedwireType.BLUESTONE).bind(right()));
    addComponent(new GateComponentWire(this, 0xC600FF, RedwireType.BLUESTONE).bind(back()));
    addComponent(new GateComponentWire(this, 0xFF0000, RedwireType.BLUESTONE).bind(left()));
    addComponent(b1 = new GateComponentSiliconChip(this, 0x0000FF));
    addComponent(b2 = new GateComponentSiliconChip(this, 0x00ccff));
    addComponent(new GateComponentBorder(this, 0x7D7D7D));
}
Also used : GateComponentSiliconChip(com.bluepowermod.part.gate.component.GateComponentSiliconChip) GateComponentWire(com.bluepowermod.part.gate.component.GateComponentWire) GateComponentTorch(com.bluepowermod.part.gate.component.GateComponentTorch) GateComponentBorder(com.bluepowermod.part.gate.component.GateComponentBorder)

Example 2 with GateComponentSiliconChip

use of com.bluepowermod.part.gate.component.GateComponentSiliconChip in project BluePower by Qmunity.

the class RenderCircuitTile method renderItem.

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    boolean blend = GL11.glGetBoolean(GL11.GL_BLEND);
    boolean alpha = GL11.glGetBoolean(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glPushMatrix();
    {
        switch(type) {
            case ENTITY:
                GL11.glTranslated(-0.5, 0, -0.5);
                break;
            case EQUIPPED:
                GL11.glTranslated(-0.375, 0.5, -0.125);
                GL11.glScaled(1.5, 1.5, 1.5);
                break;
            case EQUIPPED_FIRST_PERSON:
                GL11.glTranslated(-0.375, 0.75, -0.125);
                GL11.glScaled(1.5, 1.5, 1.5);
                break;
            case INVENTORY:
                GL11.glTranslated(0, 0.4, 0);
                GL11.glScaled(1.75, 1.75, 1.75);
                break;
            default:
                break;
        }
        Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
        Tessellator.instance.startDrawingQuads();
        RenderHelper rh = RenderHelper.instance;
        rh.renderBox(new Vec3dCube(4 / 16D, 0, 4 / 16D, 12 / 16D, 2 / 16D, 12 / 16D), Blocks.stone_slab.getIcon(0, 0));
        rh.reset();
        Tessellator.instance.draw();
        double wireHeight = 1 / 32D;
        double wireWidth = 1.5 / 16D;
        double bundledHeight = 4 / 32D;
        double bundledWidth = 6 / 16D;
        IIcon wireTexture = IconSupplier.wire;
        // Bluestone tiles
        rh.setColor(WireHelper.getColorForPowerLevel(RedwireType.BLUESTONE, (byte) (255 / 2)));
        if (item.getItem() == BPItems.bluestone_cathode_tile) {
            com.bluepowermod.client.render.RenderHelper.renderDigitalRedstoneTorch(0, 0, 0, 13 / 16D, true);
            Tessellator.instance.startDrawingQuads();
            rh.renderBox(new Vec3dCube(0.5 - (wireWidth / 2), 2 / 16D, 4 / 16D, 0.5 + (wireWidth / 2), 2 / 16D + wireHeight, 7 / 16D), wireTexture);
            Tessellator.instance.draw();
        }
        if (item.getItem() == BPItems.bluestone_pointer_tile) {
            com.bluepowermod.client.render.RenderHelper.renderDigitalRedstoneTorch(0, 0, 0, 13 / 16D, true);
            GL11.glPushMatrix();
            GL11.glTranslated(0.5, 0, 0.5);
            GL11.glScaled(0.875, 1, 0.875);
            GL11.glTranslated(-0.5, 0, -0.5);
            com.bluepowermod.client.render.RenderHelper.renderPointer(0, 3 / 16D, 0, 0.25);
            GL11.glPopMatrix();
            Tessellator.instance.startDrawingQuads();
            rh.renderBox(new Vec3dCube(0.5 - (wireWidth / 2), 2 / 16D, 4 / 16D, 0.5 + (wireWidth / 2), 2 / 16D + wireHeight, 7 / 16D), wireTexture);
            Tessellator.instance.draw();
        }
        if (item.getItem() == BPItems.bluestone_anode_tile) {
            Tessellator.instance.startDrawingQuads();
            rh.renderBox(new Vec3dCube(0.5 - (wireWidth / 2), 2 / 16D, 4 / 16D, 0.5 + (wireWidth / 2), 2 / 16D + wireHeight, 7.5 / 16D), wireTexture);
            rh.renderBox(new Vec3dCube(4 / 16D, 2 / 16D, 0.5 - (wireWidth / 2), 12 / 16D, 2 / 16D + wireHeight, 0.5 + (wireWidth / 2)), wireTexture);
            Tessellator.instance.draw();
        }
        if (item.getItem() == BPItems.bluestone_wire_tile) {
            Tessellator.instance.startDrawingQuads();
            rh.renderBox(new Vec3dCube(0.5 - (wireWidth / 2), 2 / 16D, 4 / 16D, 0.5 + (wireWidth / 2), 2 / 16D + wireHeight, 12 / 16D), wireTexture);
            Tessellator.instance.draw();
        }
        // Redstone tiles
        rh.setColor(WireHelper.getColorForPowerLevel(RedwireType.RED_ALLOY, (byte) (255 / 2)));
        if (item.getItem() == BPItems.redstone_cathode_tile) {
            com.bluepowermod.client.render.RenderHelper.renderAnalogRedstoneTorch(0, 0, 0, 13 / 16D, true);
            Tessellator.instance.startDrawingQuads();
            rh.renderBox(new Vec3dCube(0.5 - (wireWidth / 2), 2 / 16D, 4 / 16D, 0.5 + (wireWidth / 2), 2 / 16D + wireHeight, 7 / 16D), wireTexture);
            Tessellator.instance.draw();
        }
        if (item.getItem() == BPItems.redstone_pointer_tile) {
            com.bluepowermod.client.render.RenderHelper.renderAnalogRedstoneTorch(0, 0, 0, 13 / 16D, true);
            GL11.glPushMatrix();
            GL11.glTranslated(0.5, 0, 0.5);
            GL11.glScaled(0.875, 1, 0.875);
            GL11.glTranslated(-0.5, 0, -0.5);
            com.bluepowermod.client.render.RenderHelper.renderPointer(0, 3 / 16D, 0, 0.25);
            GL11.glPopMatrix();
            Tessellator.instance.startDrawingQuads();
            rh.renderBox(new Vec3dCube(0.5 - (wireWidth / 2), 2 / 16D, 4 / 16D, 0.5 + (wireWidth / 2), 2 / 16D + wireHeight, 7 / 16D), wireTexture);
            Tessellator.instance.draw();
        }
        if (item.getItem() == BPItems.redstone_anode_tile) {
            Tessellator.instance.startDrawingQuads();
            rh.renderBox(new Vec3dCube(0.5 - (wireWidth / 2), 2 / 16D, 4 / 16D, 0.5 + (wireWidth / 2), 2 / 16D + wireHeight, 7.5 / 16D), wireTexture);
            rh.renderBox(new Vec3dCube(4 / 16D, 2 / 16D, 0.5 - (wireWidth / 2), 12 / 16D, 2 / 16D + wireHeight, 0.5 + (wireWidth / 2)), wireTexture);
            Tessellator.instance.draw();
        }
        if (item.getItem() == BPItems.redstone_wire_tile) {
            Tessellator.instance.startDrawingQuads();
            rh.renderBox(new Vec3dCube(0.5 - (wireWidth / 2), 2 / 16D, 4 / 16D, 0.5 + (wireWidth / 2), 2 / 16D + wireHeight, 12 / 16D), wireTexture);
            Tessellator.instance.draw();
        }
        rh.setColor(0xFFFFFF);
        if (item.getItem() == BPItems.stone_bundle) {
            GL11.glPushMatrix();
            {
                GL11.glTranslated(0.5, 0, 0.5);
                GL11.glScaled(0.5, 0.5, 0.5);
                GL11.glTranslated(-0.5, 0.125, -0.5);
                Tessellator.instance.startDrawingQuads();
                rh.renderBox(new Vec3dCube(0.5 - (bundledWidth / 2), 2 / 16D, 0, 0.5 + (bundledWidth / 2), 2 / 16D + bundledHeight, 1), null, IconSupplier.wireBundledStraight1, IconSupplier.wireBundledSide1, IconSupplier.wireBundledSide2, IconSupplier.wireBundledConnection, IconSupplier.wireBundledConnection);
                Tessellator.instance.draw();
            }
            GL11.glPopMatrix();
        }
        // Misc renderers
        rh.setColor(0xFFFFFF);
        rh.addTransformation(new Translation(0.375, 0, 0.375));
        Tessellator.instance.startDrawingQuads();
        if (item.getItem() == BPItems.quartz_resonator_tile) {
            new GateComponentQuartzResonator(null, -1).renderStatic(new Vec3i(0, 0, 0), rh, 0);
        }
        if (item.getItem() == BPItems.silicon_chip_tile) {
            new GateComponentSiliconChip(null, -1).setState(true).renderStatic(new Vec3i(0, 0, 0), rh, 0);
        }
        if (item.getItem() == BPItems.tainted_silicon_chip_tile) {
            new GateComponentTaintedSiliconChip(null, -1).setState(true).renderStatic(new Vec3i(0, 0, 0), rh, 0);
        }
        Tessellator.instance.draw();
        rh.reset();
    }
    GL11.glPopMatrix();
    if (!blend)
        GL11.glDisable(GL11.GL_BLEND);
    if (!alpha)
        GL11.glDisable(GL11.GL_ALPHA_TEST);
}
Also used : Vec3i(uk.co.qmunity.lib.vec.Vec3i) GateComponentSiliconChip(com.bluepowermod.part.gate.component.GateComponentSiliconChip) Translation(uk.co.qmunity.lib.transform.Translation) RenderHelper(uk.co.qmunity.lib.client.render.RenderHelper) IIcon(net.minecraft.util.IIcon) GateComponentTaintedSiliconChip(com.bluepowermod.part.gate.component.GateComponentTaintedSiliconChip) GateComponentQuartzResonator(com.bluepowermod.part.gate.component.GateComponentQuartzResonator) Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube)

Example 3 with GateComponentSiliconChip

use of com.bluepowermod.part.gate.component.GateComponentSiliconChip in project BluePower by Qmunity.

the class GateStateCell method initComponents.

@Override
public void initComponents() {
    addComponent(t1 = new GateComponentPointer(this, 0x0000FF, 7 / 16D, true).setAngle(0.75));
    addComponent(t2 = new GateComponentTorch(this, 0x6F00B5, 4 / 16D, true).setState(false));
    addComponent(w1 = new GateComponentWire(this, 0x18FF00, RedwireType.BLUESTONE).setPower((byte) 255));
    addComponent(w2 = new GateComponentWire(this, 0x61a11d, RedwireType.BLUESTONE).setPower((byte) 255));
    addComponent(new GateComponentWire(this, 0xFFF600, RedwireType.BLUESTONE).bind(right()));
    addComponent(new GateComponentWire(this, 0xC600FF, RedwireType.BLUESTONE).bind(back()));
    addComponent(new GateComponentWire(this, 0xFF0000, RedwireType.BLUESTONE).bind(left()));
    addComponent(chip = new GateComponentSiliconChip(this, 0xd6ab17));
    addComponent(new GateComponentBorder(this, 0x7D7D7D));
}
Also used : GateComponentSiliconChip(com.bluepowermod.part.gate.component.GateComponentSiliconChip) GateComponentWire(com.bluepowermod.part.gate.component.GateComponentWire) GateComponentPointer(com.bluepowermod.part.gate.component.GateComponentPointer) GateComponentTorch(com.bluepowermod.part.gate.component.GateComponentTorch) GateComponentBorder(com.bluepowermod.part.gate.component.GateComponentBorder)

Aggregations

GateComponentSiliconChip (com.bluepowermod.part.gate.component.GateComponentSiliconChip)3 GateComponentBorder (com.bluepowermod.part.gate.component.GateComponentBorder)2 GateComponentTorch (com.bluepowermod.part.gate.component.GateComponentTorch)2 GateComponentWire (com.bluepowermod.part.gate.component.GateComponentWire)2 GateComponentPointer (com.bluepowermod.part.gate.component.GateComponentPointer)1 GateComponentQuartzResonator (com.bluepowermod.part.gate.component.GateComponentQuartzResonator)1 GateComponentTaintedSiliconChip (com.bluepowermod.part.gate.component.GateComponentTaintedSiliconChip)1 IIcon (net.minecraft.util.IIcon)1 RenderHelper (uk.co.qmunity.lib.client.render.RenderHelper)1 Translation (uk.co.qmunity.lib.transform.Translation)1 Vec3dCube (uk.co.qmunity.lib.vec.Vec3dCube)1 Vec3i (uk.co.qmunity.lib.vec.Vec3i)1