final variables and parameters

This commit is contained in:
thatsIch
2015-09-30 14:24:40 +02:00
parent 059523f543
commit 8b3a954f73
732 changed files with 9253 additions and 9256 deletions
@@ -62,7 +62,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
public String fillVar;
private Enum currentValue;
public GuiImgButton( int x, int y, Enum idx, Enum val )
public GuiImgButton( final int x, final int y, final Enum idx, final Enum val )
{
super( 0, 0, 16, "" );
@@ -166,27 +166,27 @@ public class GuiImgButton extends GuiButton implements ITooltip
}
}
private void registerApp( int iconIndex, Settings setting, Enum val, ButtonToolTips title, Object hint )
private void registerApp( final int iconIndex, final Settings setting, final Enum val, final ButtonToolTips title, final Object hint )
{
ButtonAppearance a = new ButtonAppearance();
final ButtonAppearance a = new ButtonAppearance();
a.displayName = title.getUnlocalized();
a.displayValue = (String) ( hint instanceof String ? hint : ( (ButtonToolTips) hint ).getUnlocalized() );
a.index = iconIndex;
appearances.put( new EnumPair( setting, val ), a );
}
public void setVisibility( boolean vis )
public void setVisibility( final boolean vis )
{
this.visible = vis;
this.enabled = vis;
}
@Override
public void drawButton( Minecraft par1Minecraft, int par2, int par3 )
public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 )
{
if( this.visible )
{
int iconIndex = this.getIconIndex();
final int iconIndex = this.getIconIndex();
if( this.halfSize )
{
@@ -209,8 +209,8 @@ public class GuiImgButton extends GuiButton implements ITooltip
par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) );
this.hovered = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
int uv_y = (int) Math.floor( iconIndex / 16 );
int uv_x = iconIndex - uv_y * 16;
final int uv_y = (int) Math.floor( iconIndex / 16 );
final int uv_x = iconIndex - uv_y * 16;
this.drawTexturedModalRect( 0, 0, 256 - 16, 256 - 16, 16, 16 );
this.drawTexturedModalRect( 0, 0, uv_x * 16, uv_y * 16, 16, 16 );
@@ -232,8 +232,8 @@ public class GuiImgButton extends GuiButton implements ITooltip
par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) );
this.hovered = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
int uv_y = (int) Math.floor( iconIndex / 16 );
int uv_x = iconIndex - uv_y * 16;
final int uv_y = (int) Math.floor( iconIndex / 16 );
final int uv_x = iconIndex - uv_y * 16;
this.drawTexturedModalRect( this.xPosition, this.yPosition, 256 - 16, 256 - 16, 16, 16 );
this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, uv_y * 16, 16, 16 );
@@ -247,7 +247,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
{
if( this.buttonSetting != null && this.currentValue != null )
{
ButtonAppearance app = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) );
final ButtonAppearance app = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) );
if( app == null )
{
return 256 - 1;
@@ -275,7 +275,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
if( this.buttonSetting != null && this.currentValue != null )
{
ButtonAppearance buttonAppearance = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) );
final ButtonAppearance buttonAppearance = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) );
if( buttonAppearance == null )
{
return "No Such Message";
@@ -305,7 +305,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
}
value = PATTERN_NEW_LINE.matcher( value ).replaceAll( "\n" );
StringBuilder sb = new StringBuilder( value );
final StringBuilder sb = new StringBuilder( value );
int i = sb.lastIndexOf( "\n" );
if( i <= 0 )
@@ -352,7 +352,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
return this.visible;
}
public void set( Enum e )
public void set( final Enum e )
{
if( this.currentValue != e )
{
@@ -366,7 +366,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
final Enum setting;
final Enum value;
EnumPair( Enum a, Enum b )
EnumPair( final Enum a, final Enum b )
{
this.setting = a;
this.value = b;
@@ -379,7 +379,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
}
@Override
public boolean equals( Object obj )
public boolean equals( final Object obj )
{
if( obj == null )
{
@@ -389,7 +389,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
{
return false;
}
EnumPair other = (EnumPair) obj;
final EnumPair other = (EnumPair) obj;
return other.setting == this.setting && other.value == this.value;
}
}
@@ -28,16 +28,16 @@ public class GuiNumberBox extends GuiTextField
final Class type;
public GuiNumberBox( FontRenderer fontRenderer, int x, int y, int width, int height, Class type )
public GuiNumberBox( final FontRenderer fontRenderer, final int x, final int y, final int width, final int height, final Class type )
{
super( 0, fontRenderer, x, y, width, height );
this.type = type;
}
@Override
public void writeText( String selectedText )
public void writeText( final String selectedText )
{
String original = this.getText();
final String original = this.getText();
super.writeText( selectedText );
try
@@ -55,7 +55,7 @@ public class GuiNumberBox extends GuiTextField
Double.parseDouble( this.getText() );
}
}
catch( NumberFormatException e )
catch( final NumberFormatException e )
{
this.setText( original );
}
@@ -37,12 +37,12 @@ public class GuiProgressBar extends GuiButton implements ITooltip
private final String titleName;
private String fullMsg;
public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int width, int height, Direction dir )
public GuiProgressBar( final IProgressProvider source, final String texture, final int posX, final int posY, final int u, final int y, final int width, final int height, final Direction dir )
{
this( source, texture, posX, posY, u, y, width, height, dir, null );
}
public GuiProgressBar( IProgressProvider source, String texture, int posX, int posY, int u, int y, int width, int height, Direction dir, String title )
public GuiProgressBar( final IProgressProvider source, final String texture, final int posX, final int posY, final int u, final int y, final int width, final int height, final Direction dir, final String title )
{
super( posX, posY, width, "" );
this.source = source;
@@ -58,22 +58,22 @@ public class GuiProgressBar extends GuiButton implements ITooltip
}
@Override
public void drawButton( Minecraft par1Minecraft, int par2, int par3 )
public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 )
{
if( this.visible )
{
par1Minecraft.getTextureManager().bindTexture( this.texture );
int max = this.source.getMaxProgress();
int current = this.source.getCurrentProgress();
final int max = this.source.getMaxProgress();
final int current = this.source.getCurrentProgress();
if( this.layout == Direction.VERTICAL )
{
int diff = this.height - ( max > 0 ? ( this.height * current ) / max : 0 );
final int diff = this.height - ( max > 0 ? ( this.height * current ) / max : 0 );
this.drawTexturedModalRect( this.xPosition, this.yPosition + diff, this.fill_u, this.fill_v + diff, this.width, this.height - diff );
}
else
{
int diff = this.width - ( max > 0 ? ( this.width * current ) / max : 0 );
final int diff = this.width - ( max > 0 ? ( this.width * current ) / max : 0 );
this.drawTexturedModalRect( this.xPosition, this.yPosition, this.fill_u + diff, this.fill_v, this.width - diff, this.height );
}
@@ -81,7 +81,7 @@ public class GuiProgressBar extends GuiButton implements ITooltip
}
}
public void setFullMsg( String msg )
public void setFullMsg( final String msg )
{
this.fullMsg = msg;
}
@@ -37,7 +37,7 @@ public class GuiScrollbar implements IScrollSource
private int minScroll = 0;
private int currentScroll = 0;
public void draw( AEBaseGui g )
public void draw( final AEBaseGui g )
{
g.bindTexture( "minecraft", "gui/container/creative_inventory/tabs.png" );
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
@@ -48,7 +48,7 @@ public class GuiScrollbar implements IScrollSource
}
else
{
int offset = ( this.currentScroll - this.minScroll ) * ( this.height - 15 ) / this.getRange();
final int offset = ( this.currentScroll - this.minScroll ) * ( this.height - 15 ) / this.getRange();
g.drawTexturedModalRect( this.displayX, offset + this.displayY, 232, 0, this.width, 15 );
}
}
@@ -63,7 +63,7 @@ public class GuiScrollbar implements IScrollSource
return this.displayX;
}
public GuiScrollbar setLeft( int v )
public GuiScrollbar setLeft( final int v )
{
this.displayX = v;
return this;
@@ -74,7 +74,7 @@ public class GuiScrollbar implements IScrollSource
return this.displayY;
}
public GuiScrollbar setTop( int v )
public GuiScrollbar setTop( final int v )
{
this.displayY = v;
return this;
@@ -85,7 +85,7 @@ public class GuiScrollbar implements IScrollSource
return this.width;
}
public GuiScrollbar setWidth( int v )
public GuiScrollbar setWidth( final int v )
{
this.width = v;
return this;
@@ -96,13 +96,13 @@ public class GuiScrollbar implements IScrollSource
return this.height;
}
public GuiScrollbar setHeight( int v )
public GuiScrollbar setHeight( final int v )
{
this.height = v;
return this;
}
public void setRange( int min, int max, int pageSize )
public void setRange( final int min, final int max, final int pageSize )
{
this.minScroll = min;
this.maxScroll = max;
@@ -127,7 +127,7 @@ public class GuiScrollbar implements IScrollSource
return this.currentScroll;
}
public void click( AEBaseGui aeBaseGui, int x, int y )
public void click( final AEBaseGui aeBaseGui, final int x, final int y )
{
if( this.getRange() == 0 )
{
@@ -39,7 +39,7 @@ public class GuiTabButton extends GuiButton implements ITooltip
private int myIcon = -1;
private ItemStack myItem;
public GuiTabButton( int x, int y, int ico, String message, RenderItem ir )
public GuiTabButton( final int x, final int y, final int ico, final String message, final RenderItem ir )
{
super( 0, 0, 16, "" );
@@ -61,7 +61,7 @@ public class GuiTabButton extends GuiButton implements ITooltip
* @param message mouse over message
* @param ir renderer
*/
public GuiTabButton( int x, int y, ItemStack ico, String message, RenderItem ir )
public GuiTabButton( final int x, final int y, final ItemStack ico, final String message, final RenderItem ir )
{
super( 0, 0, 16, "" );
this.xPosition = x;
@@ -74,7 +74,7 @@ public class GuiTabButton extends GuiButton implements ITooltip
}
@Override
public void drawButton( Minecraft minecraft, int x, int y )
public void drawButton( final Minecraft minecraft, final int x, final int y )
{
if( this.visible )
{
@@ -84,13 +84,13 @@ public class GuiTabButton extends GuiButton implements ITooltip
int uv_x = ( this.hideEdge > 0 ? 11 : 13 );
int offsetX = this.hideEdge > 0 ? 1 : 0;
final int offsetX = this.hideEdge > 0 ? 1 : 0;
this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, 0, 25, 22 );
if( this.myIcon >= 0 )
{
int uv_y = (int) Math.floor( this.myIcon / 16 );
final int uv_y = (int) Math.floor( this.myIcon / 16 );
uv_x = this.myIcon - uv_y * 16;
this.drawTexturedModalRect( offsetX + this.xPosition + 3, this.yPosition + 3, uv_x * 16, uv_y * 16, 16, 16 );
@@ -41,7 +41,7 @@ public class GuiToggleButton extends GuiButton implements ITooltip
private boolean isActive;
public GuiToggleButton( int x, int y, int on, int off, String displayName, String displayHint )
public GuiToggleButton( final int x, final int y, final int on, final int off, final String displayName, final String displayHint )
{
super( 0, 0, 16, "" );
this.iconIdxOn = on;
@@ -54,24 +54,24 @@ public class GuiToggleButton extends GuiButton implements ITooltip
this.height = 16;
}
public void setState( boolean isOn )
public void setState( final boolean isOn )
{
this.isActive = isOn;
}
@Override
public void drawButton( Minecraft par1Minecraft, int par2, int par3 )
public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 )
{
if( this.visible )
{
int iconIndex = this.getIconIndex();
final int iconIndex = this.getIconIndex();
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) );
this.hovered = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
int uv_y = (int) Math.floor( iconIndex / 16 );
int uv_x = iconIndex - uv_y * 16;
final int uv_y = (int) Math.floor( iconIndex / 16 );
final int uv_x = iconIndex - uv_y * 16;
this.drawTexturedModalRect( this.xPosition, this.yPosition, 256 - 16, 256 - 16, 16, 16 );
this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, uv_y * 16, 16, 16 );
@@ -102,7 +102,7 @@ public class GuiToggleButton extends GuiButton implements ITooltip
}
value = PATTERN_NEW_LINE.matcher( value ).replaceAll( "\n" );
StringBuilder sb = new StringBuilder( value );
final StringBuilder sb = new StringBuilder( value );
int i = sb.lastIndexOf( "\n" );
if( i <= 0 )
@@ -50,7 +50,7 @@ public class MEGuiTextField extends GuiTextField
* @param width absolute width
* @param height absolute height
*/
public MEGuiTextField( FontRenderer fontRenderer, int xPos, int yPos, int width, int height )
public MEGuiTextField( final FontRenderer fontRenderer, final int xPos, final int yPos, final int width, final int height )
{
super( 0, fontRenderer, xPos + PADDING, yPos + PADDING, width - 2 * PADDING - fontRenderer.getCharWidth( '_' ), height - 2 * PADDING );
@@ -61,7 +61,7 @@ public class MEGuiTextField extends GuiTextField
}
@Override
public void mouseClicked( int xPos, int yPos, int button )
public void mouseClicked( final int xPos, final int yPos, final int button )
{
super.mouseClicked( xPos, yPos, button );
@@ -78,7 +78,7 @@ public class MEGuiTextField extends GuiTextField
*
* @return true if mouse position is within the text field area
*/
public boolean isMouseIn( int xCoord, int yCoord )
public boolean isMouseIn( final int xCoord, final int yCoord )
{
final boolean withinXRange = this._xPos <= xCoord && xCoord < this._xPos + this._width;
final boolean withinYRange = this._yPos <= yCoord && yCoord < this._yPos + this._height;