Search in sources :

Example 1 with TileEntityThermopneumaticProcessingPlant

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

the class ModelThermopneumaticProcessingPlant method renderStatic.

@Override
public void renderStatic(float size, TileEntity te) {
    itemPart.render(size);
    inputTank.render(size);
    outputTank.render(size);
    pipe1.render(size);
    pipe2.render(size);
    pipe3.render(size);
    pipe4.render(size);
    airBottom.render(size);
    airBack.render(size);
    airLeft.render(size);
    airRight.render(size);
    if (te != null) {
        TileEntityThermopneumaticProcessingPlant processor = (TileEntityThermopneumaticProcessingPlant) te;
        FluidTankInfo info = processor.getTankInfo(null)[0];
        if (info.fluid != null && info.fluid.amount > 10) {
            float percentageFull = (float) info.fluid.amount / info.capacity;
            RenderInfo renderInfo = new RenderInfo(-8 / 16F + 0.01F, 24 / 16F - percentageFull * 9.999F / 16F, 1 / 16F + 0.01F, -1 / 16F - 0.01F, 24 / 16F - 0.01F, 8 / 16F - 0.01F);
            RenderUtils.INSTANCE.renderLiquid(info, renderInfo, processor.getWorldObj());
        }
        info = processor.getTankInfo(null)[1];
        if (info.fluid != null && info.fluid.amount > 10) {
            float percentageFull = (float) info.fluid.amount / info.capacity;
            RenderInfo renderInfo = new RenderInfo(1 / 16F + 0.01F, 24 / 16F - percentageFull * 9.999F / 16F, 1 / 16F + 0.01F, 8 / 16F - 0.01F, 24 / 16F - 0.01F, 8 / 16F - 0.01F);
            RenderUtils.INSTANCE.renderLiquid(info, renderInfo, processor.getWorldObj());
        }
    }
}
Also used : FluidTankInfo(net.minecraftforge.fluids.FluidTankInfo) TileEntityThermopneumaticProcessingPlant(pneumaticCraft.common.tileentity.TileEntityThermopneumaticProcessingPlant) RenderInfo(pneumaticCraft.client.util.RenderUtils.RenderInfo)

Aggregations

FluidTankInfo (net.minecraftforge.fluids.FluidTankInfo)1 RenderInfo (pneumaticCraft.client.util.RenderUtils.RenderInfo)1 TileEntityThermopneumaticProcessingPlant (pneumaticCraft.common.tileentity.TileEntityThermopneumaticProcessingPlant)1