Search in sources :

Example 6 with RenderInfo

use of pneumaticCraft.client.util.RenderUtils.RenderInfo 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)6 RenderInfo (pneumaticCraft.client.util.RenderUtils.RenderInfo)6 TileEntityLiquidHopper (pneumaticCraft.common.tileentity.TileEntityLiquidHopper)2 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)1 TileEntityKeroseneLamp (pneumaticCraft.common.tileentity.TileEntityKeroseneLamp)1 TileEntityPlasticMixer (pneumaticCraft.common.tileentity.TileEntityPlasticMixer)1 TileEntityRefinery (pneumaticCraft.common.tileentity.TileEntityRefinery)1 TileEntityThermopneumaticProcessingPlant (pneumaticCraft.common.tileentity.TileEntityThermopneumaticProcessingPlant)1