Improved readability of variables

Hopefully improved semantics of variables

Fixed typos

Added hyphenations
This commit is contained in:
thatsIch
2014-09-28 11:47:17 +02:00
parent 6b60a0996b
commit 76b147fd5b
220 changed files with 1643 additions and 1662 deletions
@@ -50,16 +50,16 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
{
if ( (outputId.equals( "crafting" )) && (getClass() == NEIAEShapedRecipeHandler.class) )
{
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe irecipe : allrecipes)
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe recipe : recipes)
{
if ( (irecipe instanceof ShapedRecipe) )
if ( (recipe instanceof ShapedRecipe) )
{
if ( ((ShapedRecipe) irecipe).isEnabled() )
if ( ((ShapedRecipe) recipe).isEnabled() )
{
CachedShapedRecipe recipe = new CachedShapedRecipe( (ShapedRecipe) irecipe );
recipe.computeVisuals();
arecipes.add( recipe );
CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe );
cachedRecipe.computeVisuals();
arecipes.add( cachedRecipe );
}
}
}
@@ -72,16 +72,16 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
public void loadCraftingRecipes(ItemStack result)
{
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe irecipe : allrecipes)
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe recipe : recipes)
{
if ( (irecipe instanceof ShapedRecipe) )
if ( (recipe instanceof ShapedRecipe) )
{
if ( ((ShapedRecipe) irecipe).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( irecipe.getRecipeOutput(), result ) )
if ( ((ShapedRecipe) recipe).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( recipe.getRecipeOutput(), result ) )
{
CachedShapedRecipe recipe = new CachedShapedRecipe( (ShapedRecipe) irecipe );
recipe.computeVisuals();
arecipes.add( recipe );
CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe );
cachedRecipe.computeVisuals();
arecipes.add( cachedRecipe );
}
}
}
@@ -89,20 +89,20 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
public void loadUsageRecipes(ItemStack ingredient)
{
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe irecipe : allrecipes)
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe recipe : recipes)
{
if ( (irecipe instanceof ShapedRecipe) )
if ( (recipe instanceof ShapedRecipe) )
{
CachedShapedRecipe recipe = new CachedShapedRecipe( (ShapedRecipe) irecipe );
CachedShapedRecipe cachedRecipe = new CachedShapedRecipe( (ShapedRecipe) recipe );
if ( ((ShapedRecipe) irecipe).isEnabled() && recipe.contains( recipe.ingredients, ingredient.getItem() ) )
if ( ((ShapedRecipe) recipe).isEnabled() && cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) )
{
recipe.computeVisuals();
if ( recipe.contains( recipe.ingredients, ingredient ) )
cachedRecipe.computeVisuals();
if ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient ) )
{
recipe.setIngredientPermutation( recipe.ingredients, ingredient );
arecipes.add( recipe );
cachedRecipe.setIngredientPermutation( cachedRecipe.ingredients, ingredient );
arecipes.add( cachedRecipe );
}
}
}
@@ -165,10 +165,10 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
public ArrayList<PositionedStack> ingredients;
public PositionedStack result;
public CachedShapedRecipe(ShapedRecipe irecipe) {
result = new PositionedStack( irecipe.getRecipeOutput(), 119, 24 );
public CachedShapedRecipe(ShapedRecipe recipe) {
result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 );
ingredients = new ArrayList<PositionedStack>();
setIngredients( irecipe.getWidth(), irecipe.getHeight(), irecipe.getIngredients() );
setIngredients( recipe.getWidth(), recipe.getHeight(), recipe.getIngredients() );
}
public void setIngredients(int width, int height, Object[] items)
@@ -50,16 +50,16 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
{
if ( (outputId.equals( "crafting" )) && (getClass() == NEIAEShapelessRecipeHandler.class) )
{
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe irecipe : allrecipes)
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe recipe : recipes)
{
if ( (irecipe instanceof ShapelessRecipe) )
if ( (recipe instanceof ShapelessRecipe) )
{
if ( ((ShapelessRecipe) irecipe).isEnabled() )
if ( ((ShapelessRecipe) recipe).isEnabled() )
{
CachedShapelessRecipe recipe = new CachedShapelessRecipe( (ShapelessRecipe) irecipe );
recipe.computeVisuals();
this.arecipes.add( recipe );
CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
}
}
@@ -72,16 +72,16 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
public void loadCraftingRecipes(ItemStack result)
{
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe irecipe : allrecipes)
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe recipe : recipes)
{
if ( (irecipe instanceof ShapelessRecipe) )
if ( (recipe instanceof ShapelessRecipe) )
{
if ( ((ShapelessRecipe) irecipe).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( irecipe.getRecipeOutput(), result ) )
if ( ((ShapelessRecipe) recipe).isEnabled() && NEIServerUtils.areStacksSameTypeCrafting( recipe.getRecipeOutput(), result ) )
{
CachedShapelessRecipe recipe = new CachedShapelessRecipe( (ShapelessRecipe) irecipe );
recipe.computeVisuals();
arecipes.add( recipe );
CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe );
cachedRecipe.computeVisuals();
arecipes.add( cachedRecipe );
}
}
}
@@ -89,20 +89,20 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
public void loadUsageRecipes(ItemStack ingredient)
{
List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe irecipe : allrecipes)
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (IRecipe recipe : recipes)
{
if ( (irecipe instanceof ShapelessRecipe) )
if ( (recipe instanceof ShapelessRecipe) )
{
CachedShapelessRecipe recipe = new CachedShapelessRecipe( (ShapelessRecipe) irecipe );
CachedShapelessRecipe cachedRecipe = new CachedShapelessRecipe( (ShapelessRecipe) recipe );
if ( ((ShapelessRecipe) irecipe).isEnabled() && recipe.contains( recipe.ingredients, ingredient.getItem() ) )
if ( ((ShapelessRecipe) recipe).isEnabled() && cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() ) )
{
recipe.computeVisuals();
if ( recipe.contains( recipe.ingredients, ingredient ) )
cachedRecipe.computeVisuals();
if ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient ) )
{
recipe.setIngredientPermutation( recipe.ingredients, ingredient );
this.arecipes.add( recipe );
cachedRecipe.setIngredientPermutation( cachedRecipe.ingredients, ingredient );
this.arecipes.add( cachedRecipe );
}
}
}
@@ -165,10 +165,10 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
public ArrayList<PositionedStack> ingredients;
public PositionedStack result;
public CachedShapelessRecipe(ShapelessRecipe irecipe) {
result = new PositionedStack( irecipe.getRecipeOutput(), 119, 24 );
public CachedShapelessRecipe(ShapelessRecipe recipe) {
result = new PositionedStack( recipe.getRecipeOutput(), 119, 24 );
ingredients = new ArrayList<PositionedStack>();
setIngredients( irecipe.getInput().toArray() );
setIngredients( recipe.getInput().toArray() );
}
public void setIngredients(Object[] items)
@@ -24,12 +24,12 @@ public class NEICraftingHandler implements IOverlayHandler
public NEICraftingHandler(int x, int y)
{
offsetx = x;
offsety = y;
offsetX = x;
offsetY = y;
}
int offsetx;
int offsety;
int offsetX;
int offsetY;
@Override
public void overlayRecipe(GuiContainer gui, IRecipeHandler recipe, int recipeIndex, boolean shift)
@@ -57,10 +57,10 @@ public class NEICraftingHandler implements IOverlayHandler
{
for (int i = 0; i < ingredients.size(); i++)// identify slots
{
PositionedStack pstack = ingredients.get( i );
int col = (pstack.relx - 25) / 18;
int row = (pstack.rely - 6) / 18;
if ( pstack.items != null && pstack.items.length > 0 )
PositionedStack positionedStack = ingredients.get( i );
int col = (positionedStack.relx - 25) / 18;
int row = (positionedStack.rely - 6) / 18;
if ( positionedStack.items != null && positionedStack.items.length > 0 )
{
for (Slot slot : (List<Slot>) gui.inventorySlots.inventorySlots)
{
@@ -69,26 +69,26 @@ public class NEICraftingHandler implements IOverlayHandler
Slot ctSlot = (Slot) slot;
if ( ctSlot.getSlotIndex() == col + row * 3 )
{
NBTTagList ilist = new NBTTagList();
NBTTagList tags = new NBTTagList();
List<ItemStack> list = new LinkedList();
// prefer pure crystals.
for (int x = 0; x < pstack.items.length; x++)
for (int x = 0; x < positionedStack.items.length; x++)
{
if ( Platform.isRecipePrioritized( pstack.items[x] ) )
list.add( 0, pstack.items[x] );
if ( Platform.isRecipePrioritized( positionedStack.items[x] ) )
list.add( 0, positionedStack.items[x] );
else
list.add( pstack.items[x] );
list.add( positionedStack.items[x] );
}
for (ItemStack is : list)
{
NBTTagCompound inbt = new NBTTagCompound();
is.writeToNBT( inbt );
ilist.appendTag( inbt );
NBTTagCompound tag = new NBTTagCompound();
is.writeToNBT( tag );
tags.appendTag( tag );
}
recipe.setTag( "#" + ctSlot.getSlotIndex(), ilist );
recipe.setTag( "#" + ctSlot.getSlotIndex(), tags );
break;
}
}
@@ -45,12 +45,12 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
CachedRecipe cr = this.arecipes.get( recipe );
if ( cr instanceof CachedGrindStoneRecipe )
{
CachedGrindStoneRecipe cgsr = (CachedGrindStoneRecipe) cr;
if ( cgsr.hasOptional )
CachedGrindStoneRecipe cachedRecipe = (CachedGrindStoneRecipe) cr;
if ( cachedRecipe.hasOptional )
{
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
int width = fr.getStringWidth( cgsr.Chance );
fr.drawString( cgsr.Chance, (168 - width) / 2, 5, 0 );
int width = fr.getStringWidth( cachedRecipe.Chance );
fr.drawString( cachedRecipe.Chance, (168 - width) / 2, 5, 0 );
}
else
{
@@ -83,13 +83,13 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
{
if ( (outputId.equals( "grindstone" )) && (getClass() == NEIGrinderRecipeHandler.class) )
{
for (IGrinderEntry irecipe : AEApi.instance().registries().grinder().getRecipes())
for (IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes())
{
CachedGrindStoneRecipe recipe = new CachedGrindStoneRecipe( irecipe );
if ( recipe != null )
CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe );
if ( cachedRecipe != null )
{
recipe.computeVisuals();
this.arecipes.add( recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
}
}
@@ -101,30 +101,30 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
public void loadCraftingRecipes(ItemStack result)
{
for (IGrinderEntry irecipe : AEApi.instance().registries().grinder().getRecipes())
for (IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes())
{
if ( NEIServerUtils.areStacksSameTypeCrafting( irecipe.getOutput(), result ) )
if ( NEIServerUtils.areStacksSameTypeCrafting( recipe.getOutput(), result ) )
{
CachedGrindStoneRecipe recipe = new CachedGrindStoneRecipe( irecipe );
recipe.computeVisuals();
this.arecipes.add( recipe );
CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
}
}
public void loadUsageRecipes(ItemStack ingredient)
{
for (IGrinderEntry irecipe : AEApi.instance().registries().grinder().getRecipes())
for (IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes())
{
CachedGrindStoneRecipe recipe = new CachedGrindStoneRecipe( irecipe );
CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe( recipe );
if ( (recipe != null) && (recipe.contains( recipe.ingredients, ingredient.getItem() )) )
if ( (cachedRecipe != null) && (cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() )) )
{
recipe.computeVisuals();
if ( recipe.contains( recipe.ingredients, ingredient ) )
cachedRecipe.computeVisuals();
if ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient ) )
{
recipe.setIngredientPermutation( recipe.ingredients, ingredient );
this.arecipes.add( recipe );
cachedRecipe.setIngredientPermutation( cachedRecipe.ingredients, ingredient );
this.arecipes.add( cachedRecipe );
}
}
}
@@ -169,19 +169,19 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
boolean hasOptional = false;
public String Chance;
public CachedGrindStoneRecipe(IGrinderEntry irecipe) {
result = new PositionedStack( irecipe.getOutput(), -30 + 107, 47 );
public CachedGrindStoneRecipe(IGrinderEntry recipe) {
result = new PositionedStack( recipe.getOutput(), -30 + 107, 47 );
ingredients = new ArrayList<PositionedStack>();
if ( irecipe.getOptionalOutput() != null )
if ( recipe.getOptionalOutput() != null )
{
hasOptional = true;
Chance = ((int) (irecipe.getOptionalChance() * 100)) + GuiText.OfSecondOutput.getLocal();
ingredients.add( new PositionedStack( irecipe.getOptionalOutput(), -30 + 107 + 18, 47 ) );
Chance = ((int) (recipe.getOptionalChance() * 100)) + GuiText.OfSecondOutput.getLocal();
ingredients.add( new PositionedStack( recipe.getOptionalOutput(), -30 + 107 + 18, 47 ) );
}
if ( irecipe.getInput() != null )
ingredients.add( new PositionedStack( irecipe.getInput(), 45, 24 ) );
if ( recipe.getInput() != null )
ingredients.add( new PositionedStack( recipe.getInput(), 45, 24 ) );
}
@Override
@@ -55,13 +55,13 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
{
if ( (outputId.equals( "inscriber" )) && (getClass() == NEIInscriberRecipeHandler.class) )
{
for (InscriberRecipe irecipe : Inscribe.recipes)
for (InscriberRecipe recipe : Inscribe.recipes)
{
CachedInscriberRecipe recipe = new CachedInscriberRecipe( irecipe );
if ( recipe != null )
CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
if ( cachedRecipe != null )
{
recipe.computeVisuals();
this.arecipes.add( recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
}
}
@@ -73,30 +73,30 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
public void loadCraftingRecipes(ItemStack result)
{
for (InscriberRecipe irecipe : Inscribe.recipes)
for (InscriberRecipe recipe : Inscribe.recipes)
{
if ( NEIServerUtils.areStacksSameTypeCrafting( irecipe.output, result ) )
if ( NEIServerUtils.areStacksSameTypeCrafting( recipe.output, result ) )
{
CachedInscriberRecipe recipe = new CachedInscriberRecipe( irecipe );
recipe.computeVisuals();
this.arecipes.add( recipe );
CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
cachedRecipe.computeVisuals();
this.arecipes.add( cachedRecipe );
}
}
}
public void loadUsageRecipes(ItemStack ingredient)
{
for (InscriberRecipe irecipe : Inscribe.recipes)
for (InscriberRecipe recipe : Inscribe.recipes)
{
CachedInscriberRecipe recipe = new CachedInscriberRecipe( irecipe );
CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe( recipe );
if ( (recipe != null) && (recipe.contains( recipe.ingredients, ingredient.getItem() )) )
if ( (cachedRecipe != null) && (cachedRecipe.contains( cachedRecipe.ingredients, ingredient.getItem() )) )
{
recipe.computeVisuals();
if ( recipe.contains( recipe.ingredients, ingredient ) )
cachedRecipe.computeVisuals();
if ( cachedRecipe.contains( cachedRecipe.ingredients, ingredient ) )
{
recipe.setIngredientPermutation( recipe.ingredients, ingredient );
this.arecipes.add( recipe );
cachedRecipe.setIngredientPermutation( cachedRecipe.ingredients, ingredient );
this.arecipes.add( cachedRecipe );
}
}
}
@@ -138,18 +138,18 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
public ArrayList<PositionedStack> ingredients;
public PositionedStack result;
public CachedInscriberRecipe(InscriberRecipe irecipe) {
result = new PositionedStack( irecipe.output, 108, 29 );
public CachedInscriberRecipe(InscriberRecipe recipe) {
result = new PositionedStack( recipe.output, 108, 29 );
ingredients = new ArrayList<PositionedStack>();
if ( irecipe.plateA != null )
ingredients.add( new PositionedStack( irecipe.plateA, 40, 5 ) );
if ( recipe.plateA != null )
ingredients.add( new PositionedStack( recipe.plateA, 40, 5 ) );
if ( irecipe.imprintable != null )
ingredients.add( new PositionedStack( irecipe.imprintable, 40 + 18, 28 ) );
if ( recipe.imprintable != null )
ingredients.add( new PositionedStack( recipe.imprintable, 40 + 18, 28 ) );
if ( irecipe.plateB != null )
ingredients.add( new PositionedStack( irecipe.plateB, 40, 51 ) );
if ( recipe.plateB != null )
ingredients.add( new PositionedStack( recipe.plateB, 40, 51 ) );
}
@Override
@@ -106,13 +106,13 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler
}
@Override
public List<PositionedStack> getIngredientStacks(int recipe)
public List<PositionedStack> getIngredientStacks(int recipeIndex)
{
return new ArrayList<PositionedStack>();
}
@Override
public List<PositionedStack> getOtherStacks(int recipetype)
public List<PositionedStack> getOtherStacks(int recipeIndex)
{
return new ArrayList<PositionedStack>();
}
@@ -154,15 +154,15 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler
}
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
public List<String> handleTooltip(GuiRecipe gui, List<String> currentToolTip, int recipe)
{
return currenttip;
return currentToolTip;
}
@Override
public List<String> handleItemTooltip(GuiRecipe gui, ItemStack stack, List<String> currenttip, int recipe)
public List<String> handleItemTooltip(GuiRecipe gui, ItemStack stack, List<String> currentToolTip, int recipe)
{
return currenttip;
return currentToolTip;
}
@Override