@Override
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
{
if (modelID == model)
{
TankAirLogic logic = (TankAirLogic) world.getTileEntity(x, y, z);
if (logic.hasItem())
{
ItemStack item = logic.getStackInSlot(0);
if (item.getItem() instanceof ItemBlock)
{
Block inv = Block.getBlockFromItem(item.getItem());
renderer.setOverrideBlockTexture(inv.getIcon(1, item.getItemDamage()));
renderer.renderBlockByRenderType(inv, x, y, z);
renderer.clearOverrideBlockTexture();
}
}
else if (logic.hasFluids())
{
int base = 0;
for (FluidStack fluidstack : logic.getFluids())
{
Fluid fluid = fluidstack.getFluid();
//System.out.println("Base: "+getBaseAmount(base)+", Height: "+getHeightAmount(base, fluidstack.amount)+", fluid amount: "+fluidstack.amount);
renderer.setRenderBounds(0.0, getBaseAmount(base), 0.0, 1.0, getHeightAmount(base, fluidstack.amount), 1.0);
if (fluid.canBePlacedInWorld())