Reduces visibility of internal fields/methods

Reduces the visibility of all fields to private and create setters/getters
when necessary. Exceptions are fields with GuiSync as these need to be
public.

Reduces the visibility of internal methods to private/protected/default when possible.
This commit is contained in:
yueh
2015-10-08 15:42:42 +02:00
parent 1ea48fb389
commit 500fc47490
463 changed files with 5670 additions and 3757 deletions
@@ -124,9 +124,9 @@ public class AEItemResolver implements ISubItemResolver
final String materialName = itemName.substring( itemName.indexOf( '.' ) + 1 );
final MaterialType mt = MaterialType.valueOf( materialName );
// itemName = itemName.substring( 0, itemName.indexOf( "." ) );
if( mt.itemInstance == ItemMultiMaterial.instance && mt.damageValue >= 0 && mt.isRegistered() )
if( mt.getItemInstance() == ItemMultiMaterial.instance && mt.getDamageValue() >= 0 && mt.isRegistered() )
{
return new ResolverResult( "ItemMultiMaterial", mt.damageValue );
return new ResolverResult( "ItemMultiMaterial", mt.getDamageValue() );
}
}
@@ -41,8 +41,7 @@ public class GroupIngredient implements IIngredient
private final List<IIngredient> ingredients;
private final int qty;
private ItemStack[] baked;
boolean isInside = false;
private boolean isInside = false;
public GroupIngredient( final String myName, final List<IIngredient> ingredients, final int qty ) throws RecipeError
{
@@ -65,7 +64,7 @@ public class GroupIngredient implements IIngredient
this.ingredients = ingredients;
}
public IIngredient copy( final int qty ) throws RecipeError
IIngredient copy( final int qty ) throws RecipeError
{
Preconditions.checkState( qty > 0 );
return new GroupIngredient( this.name, this.ingredients, qty );
@@ -33,7 +33,7 @@ public class MissedIngredientSet extends Throwable
this.resolverResultSet = ro;
}
public ResolverResultSet getResolverResultSet()
ResolverResultSet getResolverResultSet()
{
return this.resolverResultSet;
}
+7 -7
View File
@@ -32,12 +32,12 @@ import appeng.api.recipes.ICraftHandler;
public class RecipeData
{
public final Map<String, String> aliases = new HashMap<String, String>();
public final Map<String, GroupIngredient> groups = new HashMap<String, GroupIngredient>();
final Map<String, String> aliases = new HashMap<String, String>();
final Map<String, GroupIngredient> groups = new HashMap<String, GroupIngredient>();
public final List<ICraftHandler> handlers = new LinkedList<ICraftHandler>();
public final Set<String> knownItem = new HashSet<String>();
public boolean crash = true;
public boolean exceptions = true;
public boolean errorOnMissing = true;
final List<ICraftHandler> handlers = new LinkedList<ICraftHandler>();
final Set<String> knownItem = new HashSet<String>();
boolean crash = true;
boolean exceptions = true;
boolean errorOnMissing = true;
}
@@ -120,7 +120,7 @@ public class RecipeHandler implements IRecipeHandler
return i.getNameSpace() + ':' + i.getItemName();
}
public String getName( final ItemStack is ) throws RecipeError
private String getName( final ItemStack is ) throws RecipeError
{
Preconditions.checkNotNull( is );
@@ -228,7 +228,7 @@ public class RecipeHandler implements IRecipeHandler
return realName;
}
public String alias( final String in )
String alias( final String in )
{
Preconditions.checkNotNull( in );
@@ -514,7 +514,7 @@ public class RecipeHandler implements IRecipeHandler
}
}
public List<IWebsiteSerializer> findRecipe( final ItemStack output )
private List<IWebsiteSerializer> findRecipe( final ItemStack output )
{
final List<IWebsiteSerializer> out = new LinkedList<IWebsiteSerializer>();
@@ -39,8 +39,8 @@ import appeng.util.Platform;
public class Crusher implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient[] pro_output;
private IIngredient pro_input;
private IIngredient[] pro_output;
@Override
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
@@ -36,8 +36,8 @@ import appeng.util.Platform;
public class Grind implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient[] pro_output;
private IIngredient pro_input;
private IIngredient[] pro_output;
@Override
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
@@ -39,8 +39,8 @@ import appeng.util.Platform;
public class GrindFZ implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient[] pro_output;
private IIngredient pro_input;
private IIngredient[] pro_output;
@Override
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
@@ -39,8 +39,8 @@ import appeng.util.Platform;
public class HCCrusher implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient[] pro_output;
private IIngredient pro_input;
private IIngredient[] pro_output;
@Override
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
@@ -39,8 +39,8 @@ import appeng.util.Platform;
public class Macerator implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient[] pro_output;
private IIngredient pro_input;
private IIngredient[] pro_output;
@Override
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
@@ -39,8 +39,8 @@ import appeng.util.Platform;
public class MekCrusher implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient[] pro_output;
private IIngredient pro_input;
private IIngredient[] pro_output;
@Override
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
@@ -39,8 +39,8 @@ import appeng.util.Platform;
public class MekEnrichment implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient[] pro_output;
private IIngredient pro_input;
private IIngredient[] pro_output;
@Override
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
@@ -34,8 +34,8 @@ import appeng.api.recipes.IIngredient;
public class OreRegistration implements ICraftHandler
{
final List<IIngredient> inputs;
final String name;
private final List<IIngredient> inputs;
private final String name;
public OreRegistration( final List<IIngredient> in, final String out )
{
@@ -38,8 +38,8 @@ import appeng.util.Platform;
public class Pulverizer implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient[] pro_output;
private IIngredient pro_input;
private IIngredient[] pro_output;
@Override
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
@@ -40,8 +40,8 @@ import appeng.util.Platform;
public class Shaped implements ICraftHandler, IWebsiteSerializer
{
List<List<IIngredient>> inputs;
IIngredient output;
private List<List<IIngredient>> inputs;
private IIngredient output;
private int rows;
private int cols;
@@ -40,8 +40,8 @@ import appeng.util.Platform;
public class Shapeless implements ICraftHandler, IWebsiteSerializer
{
List<IIngredient> inputs;
IIngredient output;
private List<IIngredient> inputs;
private IIngredient output;
@Override
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
@@ -37,8 +37,8 @@ import appeng.util.Platform;
public class Smelt implements ICraftHandler, IWebsiteSerializer
{
IIngredient in;
IIngredient out;
private IIngredient in;
private IIngredient out;
@Override
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError