Update Terminal RenderItem to use new durability bar.

This commit is contained in:
AlgorithmX2 2014-08-01 23:35:36 -05:00
parent e2337a1226
commit 8672e97bd3

View file

@ -45,20 +45,23 @@ public class AppEngRenderItem extends RenderItem
boolean unicodeFlag = par1FontRenderer.getUnicodeFlag();
par1FontRenderer.setUnicodeFlag( false );
if ( is.isItemDamaged() )
if ( is.getItem().showDurabilityBar( is ) )
{
int k = (int) Math.round( 13.0D - is.getItemDamageForDisplay() * 13.0D / is.getMaxDamage() );
int l = (int) Math.round( 255.0D - is.getItemDamageForDisplay() * 255.0D / is.getMaxDamage() );
double health = is.getItem().getDurabilityForDisplay( is );
int j1 = (int) Math.round( 13.0D - health * 13.0D );
int k = (int) Math.round( 255.0D - health * 255.0D );
GL11.glDisable( GL11.GL_LIGHTING );
GL11.glDisable( GL11.GL_DEPTH_TEST );
GL11.glDisable( GL11.GL_TEXTURE_2D );
GL11.glDisable( GL11.GL_ALPHA_TEST );
GL11.glDisable( GL11.GL_BLEND );
Tessellator tessellator = Tessellator.instance;
int i1 = 255 - l << 16 | l << 8;
int j1 = (255 - l) / 4 << 16 | 16128;
int l = 255 - k << 16 | k << 8;
int i1 = (255 - k) / 4 << 16 | 16128;
this.renderQuad( tessellator, par4 + 2, par5 + 13, 13, 2, 0 );
this.renderQuad( tessellator, par4 + 2, par5 + 13, 12, 1, j1 );
this.renderQuad( tessellator, par4 + 2, par5 + 13, k, 1, i1 );
this.renderQuad( tessellator, par4 + 2, par5 + 13, 12, 1, i1 );
this.renderQuad( tessellator, par4 + 2, par5 + 13, j1, 1, l );
GL11.glEnable( GL11.GL_ALPHA_TEST );
GL11.glEnable( GL11.GL_TEXTURE_2D );
GL11.glEnable( GL11.GL_LIGHTING );
GL11.glEnable( GL11.GL_DEPTH_TEST );