Search in sources :

Example 1 with GateComponentQuartzResonator

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

the class GateComparator method initComponents.

@Override
public void initComponents() {
    addComponent(t1 = new GateComponentTorch(this, 0x0000FF, 4 / 16D, false).setState(true));
    addComponent(t2 = new GateComponentTorch(this, 0x6F00B5, 4 / 16D, false).setState(true));
    addComponent(t3 = new GateComponentTorch(this, 0x3e94dc, 5 / 16D, false).setState(false));
    addComponent(w = new GateComponentWire(this, 0x18FF00, RedwireType.RED_ALLOY).setPower((byte) 255));
    addComponent(new GateComponentWire(this, 0xFFF600, RedwireType.RED_ALLOY).bind(right()));
    addComponent(new GateComponentWire(this, 0xC600FF, RedwireType.RED_ALLOY).bind(back()));
    addComponent(new GateComponentWire(this, 0xFF0000, RedwireType.RED_ALLOY).bind(left()));
    addComponent(new GateComponentQuartzResonator(this, 0xd6ab17));
    addComponent(new GateComponentBorder(this, 0x7D7D7D));
}
Also used : GateComponentWire(com.bluepowermod.part.gate.component.GateComponentWire) GateComponentTorch(com.bluepowermod.part.gate.component.GateComponentTorch) GateComponentQuartzResonator(com.bluepowermod.part.gate.component.GateComponentQuartzResonator) GateComponentBorder(com.bluepowermod.part.gate.component.GateComponentBorder)

Example 2 with GateComponentQuartzResonator

use of com.bluepowermod.part.gate.component.GateComponentQuartzResonator 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)

Aggregations

GateComponentQuartzResonator (com.bluepowermod.part.gate.component.GateComponentQuartzResonator)2 GateComponentBorder (com.bluepowermod.part.gate.component.GateComponentBorder)1 GateComponentSiliconChip (com.bluepowermod.part.gate.component.GateComponentSiliconChip)1 GateComponentTaintedSiliconChip (com.bluepowermod.part.gate.component.GateComponentTaintedSiliconChip)1 GateComponentTorch (com.bluepowermod.part.gate.component.GateComponentTorch)1 GateComponentWire (com.bluepowermod.part.gate.component.GateComponentWire)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