Skip to content

Commit

Permalink
Fix Tank rendering in inventory with enchanted stuff etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Oct 5, 2014
1 parent 093a712 commit 89796fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/tconstruct/smeltery/model/TankItemRenderer.java
Expand Up @@ -28,21 +28,23 @@ public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
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);
}
}

0 comments on commit 89796fd

Please sign in to comment.