Search in sources :

Example 1 with TileEntityPlasticMixer

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

the class ModelPlasticMixer method renderStatic.

@Override
public void renderStatic(float size, TileEntity te) {
    Shape2.render(size);
    Shape3b.render(size);
    Shape1.render(size);
    Shape3.render(size);
    Shape4b.render(size);
    Shape4.render(size);
    if (te != null) {
        TileEntityPlasticMixer mixer = (TileEntityPlasticMixer) te;
        FluidTankInfo info = mixer.getTankInfo(null)[0];
        if (info.fluid != null && info.fluid.amount > 10) {
            float percentageFull = (float) info.fluid.amount / info.capacity;
            RenderInfo renderInfo = new RenderInfo(-6 / 16F + 0.01F, 22 / 16F - percentageFull * 13.999F / 16F, -6 / 16F + 0.01F, 6 / 16F - 0.01F, 22 / 16F, 6 / 16F - 0.01F);
            RenderUtils.INSTANCE.renderLiquid(info, renderInfo, mixer.getWorldObj());
        }
    }
}
Also used : FluidTankInfo(net.minecraftforge.fluids.FluidTankInfo) TileEntityPlasticMixer(pneumaticCraft.common.tileentity.TileEntityPlasticMixer) RenderInfo(pneumaticCraft.client.util.RenderUtils.RenderInfo)

Aggregations

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