Search in sources :

Example 26 with Vec3dCube

use of uk.co.qmunity.lib.vec.Vec3dCube in project BluePower by Qmunity.

the class GateTransceiver method renderStatic.

@Override
@SideOnly(Side.CLIENT)
public boolean renderStatic(Vec3i translation, RenderHelper renderer, RenderBlocks renderBlocks, int pass) {
    super.renderStatic(translation, renderer, renderBlocks, pass);
    if (getParent() != null)
        renderer.addTransformation(new Rotation(0, 180, 0));
    IIcon obsidian = Blocks.obsidian.getIcon(0, 0);
    IIcon quartz = Blocks.quartz_block.getIcon(0, 0);
    IIcon iron = Blocks.iron_block.getIcon(0, 0);
    IIcon gold = Blocks.gold_block.getIcon(0, 0);
    // Base
    renderer.renderBox(new Vec3dCube(7 / 16D, 2 / 16D, 7 / 16D, 9 / 16D, 8 / 16D, 9 / 16D), obsidian);
    if (getParent() == null || getWorld() == null)
        renderer.addTransformation(new Rotation(0, -(System.currentTimeMillis() / 100D) % 360, 0));
    renderer.addTransformation(new Rotation(45, 0, 0));
    // Post
    renderer.renderBox(new Vec3dCube(15 / 32D, 9 / 16D, 15 / 32D, 17 / 32D, 10 / 16D, 17 / 32D), iron);
    // Ball thingy
    renderer.renderBox(new Vec3dCube(7 / 16D, 10 / 16D, 7 / 16D, 9 / 16D, 12 / 16D, 9 / 16D), gold);
    renderer.renderBox(new Vec3dCube(6 / 16D, 8 / 16D, 5 / 16D, 10 / 16D, 9 / 16D, 11 / 16D), quartz);
    renderer.renderBox(new Vec3dCube(5 / 16D, 8 / 16D, 6 / 16D, 11 / 16D, 9 / 16D, 10 / 16D), quartz);
    for (int i = 0; i < 4; i++) {
        renderer.renderBox(new Vec3dCube(5 / 16D, 9 / 16D, 10 / 16D, 6 / 16D, 10 / 16D, 11 / 16D).rotate(0, i * 90, 0, Vec3d.center), quartz);
        renderer.renderBox(new Vec3dCube(4 / 16D, 9 / 16D, 6 / 16D, 5 / 16D, 10 / 16D, 10 / 16D).rotate(0, i * 90, 0, Vec3d.center), quartz);
        renderer.renderBox(new Vec3dCube(4 / 16D, 10 / 16D, 5 / 16D, 5 / 16D, 11 / 16D, 11 / 16D).rotate(0, i * 90, 0, Vec3d.center), quartz);
        renderer.renderBox(new Vec3dCube(4 / 16D, 11 / 16D, 11 / 16D, 5 / 16D, 12 / 16D, 12 / 16D).rotate(0, i * 90, 0, Vec3d.center), quartz);
        renderer.renderBox(new Vec3dCube(3 / 16D, 11 / 16D, 4 / 16D, 4 / 16D, 12 / 16D, 12 / 16D).rotate(0, i * 90, 0, Vec3d.center), quartz);
    }
    renderer.resetTransformations();
    return true;
}
Also used : IIcon(net.minecraft.util.IIcon) Rotation(uk.co.qmunity.lib.transform.Rotation) Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 27 with Vec3dCube

use of uk.co.qmunity.lib.vec.Vec3dCube in project BluePower by Qmunity.

the class GateComponentButton method renderStatic.

@Override
public void renderStatic(Vec3i translation, RenderHelper renderer, int pass) {
    renderer.renderBox(new Vec3dCube(x, 2 / 16D, z, x + 4 / 16D, 3.5 / 16D, z + 4 / 16D), IconSupplier.gateButton);
    renderer.renderBox(new Vec3dCube(x + 1 / 32D, 3.5 / 16D, z + 1 / 32D, x + 4 / 16D - 1 / 32D, 4 / 16D, z + 4 / 16D - 1 / 32D), getIcon());
}
Also used : Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube)

Example 28 with Vec3dCube

use of uk.co.qmunity.lib.vec.Vec3dCube in project BluePower by Qmunity.

the class GateComponentCubes method renderStatic.

@Override
public void renderStatic(Vec3i translation, RenderHelper renderer, int pass) {
    renderer.setColor(getColor());
    renderer.setRenderSides(false, true, true, true, true, true);
    for (Vec3dCube c : getCubes()) renderer.renderBox(c, getIcon());
    renderer.resetRenderedSides();
    renderer.setColor(0xFFFFFF);
}
Also used : Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube)

Example 29 with Vec3dCube

use of uk.co.qmunity.lib.vec.Vec3dCube in project BluePower by Qmunity.

the class GateComponentLever method renderStatic.

@Override
public void renderStatic(Vec3i translation, RenderHelper renderer, int pass) {
    renderer.addTransformation(new Translation(x, 0, z));
    renderer.renderBox(new Vec3dCube(0, 2 / 16D, 0, 4 / 16D, 4 / 16D, 7 / 16D), Blocks.cobblestone.getIcon(0, 0));
    renderer.removeTransformation();
}
Also used : Translation(uk.co.qmunity.lib.transform.Translation) Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube)

Example 30 with Vec3dCube

use of uk.co.qmunity.lib.vec.Vec3dCube in project BluePower by Qmunity.

the class GateIntegratedCircuit method addSelectionBoxes.

@Override
public void addSelectionBoxes(List<Vec3dCube> boxes) {
    boxes.add(new Vec3dCube(0, 0, 0, 1, 1 / 16D, 1));
    boxes.add(new Vec3dCube(0, 1 / 16D, 0, 1, 2 / 16D, 1 / 16D));
    boxes.add(new Vec3dCube(0, 1 / 16D, 1 - 1 / 16D, 1, 2 / 16D, 1));
    boxes.add(new Vec3dCube(0, 1 / 16D, 0, 1 / 16D, 2 / 16D, 1));
    boxes.add(new Vec3dCube(1 - 1 / 16D, 1 / 16D, 0, 1, 2 / 16D, 1));
}
Also used : Vec3dCube(uk.co.qmunity.lib.vec.Vec3dCube)

Aggregations

Vec3dCube (uk.co.qmunity.lib.vec.Vec3dCube)37 SideOnly (cpw.mods.fml.relauncher.SideOnly)13 IIcon (net.minecraft.util.IIcon)11 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)8 ArrayList (java.util.ArrayList)7 Rotation (uk.co.qmunity.lib.transform.Rotation)6 Translation (uk.co.qmunity.lib.transform.Translation)5 TubeColor (com.bluepowermod.api.tube.IPneumaticTube.TubeColor)3 RenderHelper (uk.co.qmunity.lib.client.render.RenderHelper)3 IScrewdriver (com.bluepowermod.api.misc.IScrewdriver)2 BlockLamp (com.bluepowermod.block.machine.BlockLamp)2 ItemPart (com.bluepowermod.item.ItemPart)2 PartRedwireFaceUninsulated (com.bluepowermod.part.wire.redstone.PartRedwireFace.PartRedwireFaceUninsulated)2 ItemStack (net.minecraft.item.ItemStack)2 Vec3d (uk.co.qmunity.lib.vec.Vec3d)2 Vec3i (uk.co.qmunity.lib.vec.Vec3i)2 IGateComponent (com.bluepowermod.api.gate.IGateComponent)1 IIntegratedCircuitPart (com.bluepowermod.api.gate.IIntegratedCircuitPart)1 BPPart (com.bluepowermod.part.BPPart)1 GateComponentQuartzResonator (com.bluepowermod.part.gate.component.GateComponentQuartzResonator)1