Refactoring
Type-safety Minor performance improvements
This commit is contained in:
@@ -18,9 +18,11 @@
|
||||
|
||||
package appeng.recipes.handlers;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.exceptions.MissingIngredientError;
|
||||
import appeng.api.exceptions.RecipeError;
|
||||
@@ -67,7 +69,7 @@ public class Grind implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public String getPattern( RecipeHandler h ) {
|
||||
return "grind\n"+
|
||||
h.getName(pro_input)+"\n"+
|
||||
h.getName(pro_input)+ '\n' +
|
||||
h.getName(pro_output[0]);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,12 +18,14 @@
|
||||
|
||||
package appeng.recipes.handlers;
|
||||
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.exceptions.MissingIngredientError;
|
||||
import appeng.api.exceptions.RecipeError;
|
||||
import appeng.api.exceptions.RegistrationError;
|
||||
@@ -117,17 +119,17 @@ public class Inscribe implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public String getPattern(RecipeHandler h)
|
||||
{
|
||||
String o = "inscriber " + output.getQty() + "\n";
|
||||
String o = "inscriber " + output.getQty() + '\n';
|
||||
|
||||
o += h.getName( output ) + "\n";
|
||||
o += h.getName( output ) + '\n';
|
||||
|
||||
if ( plateA != null )
|
||||
o += h.getName( plateA )+"\n";
|
||||
o += h.getName( plateA )+ '\n';
|
||||
|
||||
o += h.getName(imprintable);
|
||||
|
||||
if ( plateB != null )
|
||||
o += "\n"+h.getName( plateB );
|
||||
o += '\n' +h.getName( plateB );
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
@@ -18,10 +18,14 @@
|
||||
|
||||
package appeng.recipes.handlers;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import appeng.api.exceptions.MissingIngredientError;
|
||||
import appeng.api.exceptions.RecipeError;
|
||||
import appeng.api.exceptions.RegistrationError;
|
||||
@@ -31,7 +35,6 @@ import appeng.core.AELog;
|
||||
import appeng.recipes.RecipeHandler;
|
||||
import appeng.recipes.game.ShapedRecipe;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class Shaped implements ICraftHandler, IWebsiteSerializer
|
||||
{
|
||||
@@ -86,7 +89,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
|
||||
for (int x = 0; x < cols; x++)
|
||||
{
|
||||
if ( inputs.get( y ).get( x ).isAir() )
|
||||
row.append( " " );
|
||||
row.append( ' ' );
|
||||
else
|
||||
{
|
||||
row.append( first );
|
||||
@@ -136,9 +139,9 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public String getPattern(RecipeHandler h)
|
||||
{
|
||||
String o = "shaped " + output.getQty() + " " + cols + "x" + rows + "\n";
|
||||
String o = "shaped " + output.getQty() + ' ' + cols + 'x' + rows + '\n';
|
||||
|
||||
o += h.getName( output ) + "\n";
|
||||
o += h.getName( output ) + '\n';
|
||||
|
||||
for (int y = 0; y < rows; y++)
|
||||
for (int x = 0; x < cols; x++)
|
||||
|
||||
@@ -18,10 +18,14 @@
|
||||
|
||||
package appeng.recipes.handlers;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import appeng.api.exceptions.MissingIngredientError;
|
||||
import appeng.api.exceptions.RecipeError;
|
||||
import appeng.api.exceptions.RegistrationError;
|
||||
@@ -31,7 +35,6 @@ import appeng.core.AELog;
|
||||
import appeng.recipes.RecipeHandler;
|
||||
import appeng.recipes.game.ShapelessRecipe;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class Shapeless implements ICraftHandler, IWebsiteSerializer
|
||||
{
|
||||
@@ -100,9 +103,9 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public String getPattern(RecipeHandler h)
|
||||
{
|
||||
StringBuilder o = new StringBuilder( "shapeless " + output.getQty() + "\n" );
|
||||
StringBuilder o = new StringBuilder( "shapeless " + output.getQty() + '\n' );
|
||||
|
||||
o.append( h.getName( output ) ).append( "\n" );
|
||||
o.append( h.getName( output ) ).append( '\n' );
|
||||
|
||||
for (int y = 0; y < inputs.size(); y++)
|
||||
{
|
||||
@@ -119,11 +122,11 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer
|
||||
|
||||
if ( y + 1 == this.inputs.size() )
|
||||
{
|
||||
o.append( "\n" );
|
||||
o.append( '\n' );
|
||||
}
|
||||
else
|
||||
{
|
||||
o.append( " " );
|
||||
o.append( ' ' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,13 @@
|
||||
|
||||
package appeng.recipes.handlers;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import appeng.api.exceptions.MissingIngredientError;
|
||||
import appeng.api.exceptions.RecipeError;
|
||||
import appeng.api.exceptions.RegistrationError;
|
||||
@@ -28,7 +32,6 @@ import appeng.api.recipes.ICraftHandler;
|
||||
import appeng.api.recipes.IIngredient;
|
||||
import appeng.recipes.RecipeHandler;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class Smelt implements ICraftHandler, IWebsiteSerializer
|
||||
{
|
||||
@@ -72,8 +75,8 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer
|
||||
|
||||
@Override
|
||||
public String getPattern( RecipeHandler h ) {
|
||||
return "smelt "+out.getQty()+"\n"+
|
||||
h.getName(out)+"\n"+
|
||||
return "smelt "+out.getQty()+ '\n' +
|
||||
h.getName(out)+ '\n' +
|
||||
h.getName(in);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user