Code cleanup

Added missing this, annotations, etc.
This commit is contained in:
yueh
2018-08-30 20:33:08 +02:00
parent fed12cb99f
commit a2091d10fe
77 changed files with 227 additions and 270 deletions
@@ -89,13 +89,13 @@ public class GrinderRecipes
@Override
public void apply()
{
AEApi.instance().registries().grinder().addRecipe( entry );
AEApi.instance().registries().grinder().addRecipe( this.entry );
}
@Override
public String describe()
{
return "Adding Grinder Entry for " + entry.getInput().getDisplayName();
return "Adding Grinder Entry for " + this.entry.getInput().getDisplayName();
}
}
@@ -111,7 +111,7 @@ public class GrinderRecipes
@Override
public void apply()
{
IGrinderRecipe recipe = AEApi.instance().registries().grinder().getRecipeForInput( stack );
IGrinderRecipe recipe = AEApi.instance().registries().grinder().getRecipeForInput( this.stack );
if( recipe != null )
{
AEApi.instance().registries().grinder().removeRecipe( recipe );
@@ -121,7 +121,7 @@ public class GrinderRecipes
@Override
public String describe()
{
return "Removing Grinder Entry for " + stack.getDisplayName();
return "Removing Grinder Entry for " + this.stack.getDisplayName();
}
}
}
@@ -98,13 +98,13 @@ public class InscriberRecipes
@Override
public void apply()
{
AEApi.instance().registries().inscriber().addRecipe( entry );
AEApi.instance().registries().inscriber().addRecipe( this.entry );
}
@Override
public String describe()
{
return "Adding Inscriber Entry for " + entry.getOutput().getDisplayName();
return "Adding Inscriber Entry for " + this.entry.getOutput().getDisplayName();
}
}
@@ -131,7 +131,7 @@ public class InscriberRecipes
@Override
public String describe()
{
return "Removing Inscriber Entry for " + stack.getDisplayName();
return "Removing Inscriber Entry for " + this.stack.getDisplayName();
}
}
@@ -18,7 +18,7 @@ public class InventoryTweaksModule implements IInvTweaks
{
try
{
api = (InvTweaksAPI) Class.forName( "invtweaks.forge.InvTweaksMod", true, Loader.instance().getModClassLoader() )
this.api = (InvTweaksAPI) Class.forName( "invtweaks.forge.InvTweaksMod", true, Loader.instance().getModClassLoader() )
.getField( "instance" )
.get( null );
}
@@ -30,12 +30,12 @@ public class InventoryTweaksModule implements IInvTweaks
@Override
public boolean isEnabled()
{
return api != null;
return this.api != null;
}
@Override
public int compareItems( ItemStack i, ItemStack j )
{
return api.compareItems( i, j );
return this.api.compareItems( i, j );
}
}
@@ -27,6 +27,7 @@ import appeng.api.features.IGrinderRecipe;
class GrinderRecipeHandler implements IRecipeWrapperFactory<IGrinderRecipe>
{
@Override
public IRecipeWrapper getRecipeWrapper( IGrinderRecipe recipe )
{
return new GrinderRecipeWrapper( recipe );
@@ -71,7 +71,7 @@ class GrinderRecipeWrapper implements IRecipeWrapper
{
String text = String.format( "%d%%", (int) ( this.recipe.getOptionalChance() * 100 ) );
float width = fr.getStringWidth( text ) * scale;
int xScaled = (int) Math.round( ( x + ( 18 - width ) / 2 ) * invScale );
int xScaled = Math.round( ( x + ( 18 - width ) / 2 ) * invScale );
fr.drawString( text, xScaled, (int) ( 65 * invScale ), Color.gray.getRGB() );
x += 18;
}
@@ -80,7 +80,7 @@ class GrinderRecipeWrapper implements IRecipeWrapper
{
String text = String.format( "%d%%", (int) ( this.recipe.getSecondOptionalChance() * 100 ) );
float width = fr.getStringWidth( text ) * scale;
int xScaled = (int) Math.round( ( x + ( 18 - width ) / 2 ) * invScale );
int xScaled = Math.round( ( x + ( 18 - width ) / 2 ) * invScale );
fr.drawString( text, xScaled, (int) ( 65 * invScale ), Color.gray.getRGB() );
}