final variables and parameters
seeing some methods it does actually help to enforce the parameters
This commit is contained in:
@@ -49,30 +49,30 @@ public class AppEngRenderItem extends RenderItem
|
||||
public IAEItemStack aeStack;
|
||||
|
||||
@Override
|
||||
public void renderItemOverlayIntoGUI( FontRenderer fontRenderer, TextureManager textureManager, ItemStack is, int par4, int par5, String par6Str )
|
||||
public void renderItemOverlayIntoGUI( final FontRenderer fontRenderer, final TextureManager textureManager, final ItemStack is, final int par4, final int par5, final String par6Str )
|
||||
{
|
||||
if( is != null )
|
||||
{
|
||||
float scaleFactor = AEConfig.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f;
|
||||
float inverseScaleFactor = 1.0f / scaleFactor;
|
||||
int offset = AEConfig.instance.useTerminalUseLargeFont() ? 0 : -1;
|
||||
final float scaleFactor = AEConfig.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f;
|
||||
final float inverseScaleFactor = 1.0f / scaleFactor;
|
||||
final int offset = AEConfig.instance.useTerminalUseLargeFont() ? 0 : -1;
|
||||
|
||||
boolean unicodeFlag = fontRenderer.getUnicodeFlag();
|
||||
final boolean unicodeFlag = fontRenderer.getUnicodeFlag();
|
||||
fontRenderer.setUnicodeFlag( false );
|
||||
|
||||
if( is.getItem().showDurabilityBar( is ) )
|
||||
{
|
||||
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 );
|
||||
final double health = is.getItem().getDurabilityForDisplay( is );
|
||||
final int j1 = (int) Math.round( 13.0D - health * 13.0D );
|
||||
final 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 l = 255 - k << 16 | k << 8;
|
||||
int i1 = ( 255 - k ) / 4 << 16 | 16128;
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
final int l = 255 - k << 16 | k << 8;
|
||||
final 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, i1 );
|
||||
this.renderQuad( tessellator, par4 + 2, par5 + 13, j1, 1, l );
|
||||
@@ -85,20 +85,20 @@ public class AppEngRenderItem extends RenderItem
|
||||
|
||||
if( is.stackSize == 0 )
|
||||
{
|
||||
String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal();
|
||||
final String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal();
|
||||
GL11.glDisable( GL11.GL_LIGHTING );
|
||||
GL11.glDisable( GL11.GL_DEPTH_TEST );
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScaled( scaleFactor, scaleFactor, scaleFactor );
|
||||
int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( craftLabelText ) * scaleFactor ) * inverseScaleFactor );
|
||||
int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor );
|
||||
final int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( craftLabelText ) * scaleFactor ) * inverseScaleFactor );
|
||||
final int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor );
|
||||
fontRenderer.drawStringWithShadow( craftLabelText, X, Y, 16777215 );
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable( GL11.GL_LIGHTING );
|
||||
GL11.glEnable( GL11.GL_DEPTH_TEST );
|
||||
}
|
||||
|
||||
long amount = this.aeStack != null ? this.aeStack.getStackSize() : is.stackSize;
|
||||
final long amount = this.aeStack != null ? this.aeStack.getStackSize() : is.stackSize;
|
||||
if( amount != 0 )
|
||||
{
|
||||
final String stackSize = this.getToBeRenderedStackSize( amount );
|
||||
@@ -107,8 +107,8 @@ public class AppEngRenderItem extends RenderItem
|
||||
GL11.glDisable( GL11.GL_DEPTH_TEST );
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScaled( scaleFactor, scaleFactor, scaleFactor );
|
||||
int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( stackSize ) * scaleFactor ) * inverseScaleFactor );
|
||||
int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor );
|
||||
final int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( stackSize ) * scaleFactor ) * inverseScaleFactor );
|
||||
final int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor );
|
||||
fontRenderer.drawStringWithShadow( stackSize, X, Y, 16777215 );
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable( GL11.GL_LIGHTING );
|
||||
@@ -119,7 +119,7 @@ public class AppEngRenderItem extends RenderItem
|
||||
}
|
||||
}
|
||||
|
||||
private void renderQuad( Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6 )
|
||||
private void renderQuad( final Tessellator par1Tessellator, final int par2, final int par3, final int par4, final int par5, final int par6 )
|
||||
{
|
||||
par1Tessellator.startDrawingQuads();
|
||||
par1Tessellator.setColorOpaque_I( par6 );
|
||||
@@ -130,7 +130,7 @@ public class AppEngRenderItem extends RenderItem
|
||||
par1Tessellator.draw();
|
||||
}
|
||||
|
||||
private String getToBeRenderedStackSize( long originalSize )
|
||||
private String getToBeRenderedStackSize( final long originalSize )
|
||||
{
|
||||
if( AEConfig.instance.useTerminalUseLargeFont() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user