Search in sources :

Example 1 with TileEntityVortexTube

use of pneumaticCraft.common.tileentity.TileEntityVortexTube in project PneumaticCraft by MineMaarten.

the class ModelVortexTube method renderAll.

@Override
protected void renderAll(TileEntity te) {
    if (te instanceof TileEntityVortexTube) {
        TileEntityVortexTube tube = (TileEntityVortexTube) te;
        int coldHeat = tube.getColdHeatLevel();
        int hotHeat = tube.getHotHeatLevel();
        model.renderAllExcept("Cold", "Hot_1", "Hot_2");
        double[] color = TileEntityCompressedIronBlock.getColorForHeatLevel(coldHeat);
        GL11.glColor4d(color[0], color[1], color[2], 1);
        model.renderOnly("Cold");
        color = TileEntityCompressedIronBlock.getColorForHeatLevel(hotHeat);
        GL11.glColor4d(color[0], color[1], color[2], 1);
        model.renderOnly("Hot_1", "Hot_2");
        GL11.glColor4d(1, 1, 1, 1);
    } else {
        super.renderAll(te);
    }
}
Also used : TileEntityVortexTube(pneumaticCraft.common.tileentity.TileEntityVortexTube)

Example 2 with TileEntityVortexTube

use of pneumaticCraft.common.tileentity.TileEntityVortexTube in project PneumaticCraft by MineMaarten.

the class BlockVortexTube method onBlockPlacedBy.

@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) {
    super.onBlockPlacedBy(world, x, y, z, par5EntityLiving, par6ItemStack);
    TileEntityVortexTube te = (TileEntityVortexTube) world.getTileEntity(x, y, z);
    for (int i = 0; i < 4; i++) {
        te.rotateRoll(1);
        ForgeDirection d = te.getTubeDirection();
        IPneumaticMachine pneumaticMachine = ModInteractionUtils.getInstance().getMachine(world.getTileEntity(x + d.offsetX, y + d.offsetY, z + d.offsetZ));
        if (pneumaticMachine != null && pneumaticMachine.isConnectedTo(d.getOpposite()))
            break;
    }
}
Also used : TileEntityVortexTube(pneumaticCraft.common.tileentity.TileEntityVortexTube) IPneumaticMachine(pneumaticCraft.api.tileentity.IPneumaticMachine) ForgeDirection(net.minecraftforge.common.util.ForgeDirection)

Example 3 with TileEntityVortexTube

use of pneumaticCraft.common.tileentity.TileEntityVortexTube in project PneumaticCraft by MineMaarten.

the class BlockVortexTube method rotateCustom.

@Override
protected boolean rotateCustom(World world, int x, int y, int z, ForgeDirection side, int meta) {
    if (meta == side.ordinal() || meta == side.getOpposite().ordinal()) {
        TileEntityVortexTube te = (TileEntityVortexTube) world.getTileEntity(x, y, z);
        te.rotateRoll(meta == side.ordinal() ? 1 : -1);
        return true;
    } else {
        return false;
    }
}
Also used : TileEntityVortexTube(pneumaticCraft.common.tileentity.TileEntityVortexTube)

Aggregations

TileEntityVortexTube (pneumaticCraft.common.tileentity.TileEntityVortexTube)3 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)1 IPneumaticMachine (pneumaticCraft.api.tileentity.IPneumaticMachine)1