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);
}
}
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;
}
}
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;
}
}
Aggregations