final variables and parameters

seeing some methods it does actually help to enforce the parameters
This commit is contained in:
thatsIch
2015-09-25 23:10:56 +02:00
parent e52400bf26
commit 410d2f1e0d
819 changed files with 9390 additions and 9396 deletions
@@ -38,13 +38,13 @@ public class ItemEncodedPatternRenderer implements IItemRenderer
boolean recursive;
@Override
public boolean handleRenderType( ItemStack item, ItemRenderType type )
public boolean handleRenderType( final ItemStack item, final ItemRenderType type )
{
boolean isShiftHeld = Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) || Keyboard.isKeyDown( Keyboard.KEY_RSHIFT );
final boolean isShiftHeld = Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) || Keyboard.isKeyDown( Keyboard.KEY_RSHIFT );
if( !this.recursive && type == IItemRenderer.ItemRenderType.INVENTORY && isShiftHeld )
{
ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem();
final ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem();
if( iep.getOutput( item ) != null )
{
return true;
@@ -55,20 +55,20 @@ public class ItemEncodedPatternRenderer implements IItemRenderer
}
@Override
public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper )
public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper )
{
return false;
}
@Override
public void renderItem( ItemRenderType type, ItemStack item, Object... data )
public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data )
{
this.recursive = true;
ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem();
final ItemEncodedPattern iep = (ItemEncodedPattern) item.getItem();
ItemStack is = iep.getOutput( item );
Minecraft mc = Minecraft.getMinecraft();
final ItemStack is = iep.getOutput( item );
final Minecraft mc = Minecraft.getMinecraft();
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
RenderHelper.enableGUIStandardItemLighting();
@@ -36,19 +36,19 @@ public class PaintBallRender implements IItemRenderer
{
@Override
public boolean handleRenderType( ItemStack item, ItemRenderType type )
public boolean handleRenderType( final ItemStack item, final ItemRenderType type )
{
return true;
}
@Override
public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper )
public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper )
{
return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION;
}
@Override
public void renderItem( ItemRenderType type, ItemStack item, Object... data )
public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data )
{
IIcon par2Icon = item.getIconIndex();
if( item.getItemDamage() >= 20 )
@@ -56,28 +56,28 @@ public class PaintBallRender implements IItemRenderer
par2Icon = ExtraItemTextures.ItemPaintBallShimmer.getIcon();
}
float f4 = par2Icon.getMinU();
float f5 = par2Icon.getMaxU();
float f6 = par2Icon.getMinV();
float f7 = par2Icon.getMaxV();
final float f4 = par2Icon.getMinU();
final float f5 = par2Icon.getMaxU();
final float f6 = par2Icon.getMinV();
final float f7 = par2Icon.getMaxV();
ItemPaintBall ipb = (ItemPaintBall) item.getItem();
final ItemPaintBall ipb = (ItemPaintBall) item.getItem();
Tessellator tessellator = Tessellator.instance;
final Tessellator tessellator = Tessellator.instance;
GL11.glPushMatrix();
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
AEColor col = ipb.getColor( item );
final AEColor col = ipb.getColor( item );
int colorValue = item.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant;
int r = ( colorValue >> 16 ) & 0xff;
int g = ( colorValue >> 8 ) & 0xff;
int b = ( colorValue ) & 0xff;
final int colorValue = item.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant;
final int r = ( colorValue >> 16 ) & 0xff;
final int g = ( colorValue >> 8 ) & 0xff;
final int b = ( colorValue ) & 0xff;
if( item.getItemDamage() >= 20 )
{
float fail = 0.7f;
int full = (int) ( 255 * 0.3 );
final float fail = 0.7f;
final int full = (int) ( 255 * 0.3 );
GL11.glColor4ub( (byte) ( full + r * fail ), (byte) ( full + g * fail ), (byte) ( full + b * fail ), (byte) 255 );
}
else
@@ -110,7 +110,7 @@ public class PaintBallRender implements IItemRenderer
{
GL11.glTranslatef( -0.5F, -0.3F, 0.01F );
}
float f12 = 0.0625F;
final float f12 = 0.0625F;
ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 );
GL11.glDisable( GL11.GL_CULL_FACE );
@@ -38,28 +38,28 @@ public class ToolBiometricCardRender implements IItemRenderer
{
@Override
public boolean handleRenderType( ItemStack item, ItemRenderType type )
public boolean handleRenderType( final ItemStack item, final ItemRenderType type )
{
return true;
}
@Override
public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper )
public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper )
{
return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION;
}
@Override
public void renderItem( ItemRenderType type, ItemStack item, Object... data )
public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data )
{
IIcon par2Icon = item.getIconIndex();
final IIcon par2Icon = item.getIconIndex();
float f4 = par2Icon.getMinU();
float f5 = par2Icon.getMaxU();
float f6 = par2Icon.getMinV();
float f7 = par2Icon.getMaxV();
final float f4 = par2Icon.getMinU();
final float f5 = par2Icon.getMaxU();
final float f6 = par2Icon.getMinV();
final float f7 = par2Icon.getMaxV();
Tessellator tessellator = Tessellator.instance;
final Tessellator tessellator = Tessellator.instance;
GL11.glPushMatrix();
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
@@ -82,7 +82,7 @@ public class ToolBiometricCardRender implements IItemRenderer
else
{
GL11.glTranslatef( -0.5F, -0.3F, 0.01F );
float f12 = 0.0625F;
final float f12 = 0.0625F;
ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 );
GL11.glDisable( GL11.GL_CULL_FACE );
@@ -92,19 +92,19 @@ public class ToolBiometricCardRender implements IItemRenderer
GL11.glRotatef( 180F, 1.0F, 0.0F, 0.0F );
}
float u = ExtraItemTextures.White.getIcon().getInterpolatedU( 8.1 );
float v = ExtraItemTextures.White.getIcon().getInterpolatedV( 8.1 );
final float u = ExtraItemTextures.White.getIcon().getInterpolatedU( 8.1 );
final float v = ExtraItemTextures.White.getIcon().getInterpolatedV( 8.1 );
String username = "";
if( item.getItem() instanceof IBiometricCard )
{
GameProfile gp = ( (IBiometricCard) item.getItem() ).getProfile( item );
final GameProfile gp = ( (IBiometricCard) item.getItem() ).getProfile( item );
if( gp != null )
{
username = gp.getName();
}
}
int hash = username.length() > 0 ? username.hashCode() : 0;
final int hash = username.length() > 0 ? username.hashCode() : 0;
GL11.glScalef( 1F / 16F, 1F / 16F, 1F );
GL11.glTranslatef( 4, 6, 0 );
@@ -118,7 +118,7 @@ public class ToolBiometricCardRender implements IItemRenderer
col = AEColor.Black;
}
float z = 0;
final float z = 0;
for( int x = 0; x < 8; x++ )// 8
{
for( int y = 0; y < 6; y++ )// 6
@@ -140,7 +140,7 @@ public class ToolBiometricCardRender implements IItemRenderer
}
else
{
float scale = 0.3f / 255.0f;
final float scale = 0.3f / 255.0f;
tessellator.setColorOpaque_F( ( ( col.blackVariant >> 16 ) & 0xff ) * scale, ( ( col.blackVariant >> 8 ) & 0xff ) * scale, ( col.blackVariant & 0xff ) * scale );
}
@@ -36,28 +36,28 @@ public class ToolColorApplicatorRender implements IItemRenderer
{
@Override
public boolean handleRenderType( ItemStack item, ItemRenderType type )
public boolean handleRenderType( final ItemStack item, final ItemRenderType type )
{
return true;
}
@Override
public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper )
public boolean shouldUseRenderHelper( final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper )
{
return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION;
}
@Override
public void renderItem( ItemRenderType type, ItemStack item, Object... data )
public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data )
{
IIcon par2Icon = item.getIconIndex();
final IIcon par2Icon = item.getIconIndex();
float f4 = par2Icon.getMinU();
float f5 = par2Icon.getMaxU();
float f6 = par2Icon.getMinV();
float f7 = par2Icon.getMaxV();
Tessellator tessellator = Tessellator.instance;
final Tessellator tessellator = Tessellator.instance;
GL11.glPushMatrix();
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
@@ -91,7 +91,7 @@ public class ToolColorApplicatorRender implements IItemRenderer
{
GL11.glTranslatef( -0.5F, -0.3F, 0.01F );
}
float f12 = 0.0625F;
final float f12 = 0.0625F;
ItemRenderer.renderItemIn2D( tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12 );
GL11.glDisable( GL11.GL_CULL_FACE );
@@ -101,9 +101,9 @@ public class ToolColorApplicatorRender implements IItemRenderer
GL11.glRotatef( 180F, 1.0F, 0.0F, 0.0F );
}
IIcon dark = ExtraItemTextures.ToolColorApplicatorTip_Dark.getIcon();
IIcon med = ExtraItemTextures.ToolColorApplicatorTip_Medium.getIcon();
IIcon light = ExtraItemTextures.ToolColorApplicatorTip_Light.getIcon();
final IIcon dark = ExtraItemTextures.ToolColorApplicatorTip_Dark.getIcon();
final IIcon med = ExtraItemTextures.ToolColorApplicatorTip_Medium.getIcon();
final IIcon light = ExtraItemTextures.ToolColorApplicatorTip_Light.getIcon();
GL11.glScalef( 1F / 16F, 1F / 16F, 1F );
if( type != ItemRenderType.INVENTORY )
@@ -112,7 +112,7 @@ public class ToolColorApplicatorRender implements IItemRenderer
}
GL11.glDisable( GL11.GL_LIGHTING );
AEColor col = ( (ToolColorApplicator) item.getItem() ).getActiveColor( item );
final AEColor col = ( (ToolColorApplicator) item.getItem() ).getActiveColor( item );
if( col != null )
{