Fix Tank rendering in inventory with enchanted stuff etc.

This commit is contained in:
Bernhard Bonigl committed 2014-10-05 17:35:09 +02:00
1 parent 093a712fdb
commit 89796fde81
1 file changed
+4 -2
@@ -28,21 +28,23 @@ public class TankItemRenderer implements IItemRenderer {
Block block = Block.getBlockFromItem(item.getItem());
int meta = item.getItemDamage();
GL11.glEnable(GL11.GL_BLEND);
if(item.hasTagCompound() && item.getTagCompound().hasKey("Fluid"))
{
FluidStack liquid = FluidStack.loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("Fluid"));
if(liquid != null && liquid.getFluid().getBlock() != null)
{
GL11.glEnable(GL11.GL_BLEND);
float height = (float)liquid.amount / 4000f - 0.01f;
renderblocks.setRenderBounds(0.01, 0.01, 0.01, 0.99, height, 0.99);
ItemHelper.renderStandardInvBlock(renderblocks, liquid.getFluid().getBlock(), 0);
GL11.glDisable(GL11.GL_BLEND);
}
}
GL11.glEnable(GL11.GL_ALPHA_TEST);
renderblocks.setRenderBounds(0, 0, 0, 1, 1, 1);
//ItemHelper.renderStandardInvBlock(renderblocks, block, meta);
RenderingRegistry.instance().renderInventoryBlock(renderblocks, block, meta, TankRender.tankModelID);
GL11.glDisable(GL11.GL_ALPHA_TEST);
}
}