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
@@ -41,7 +41,7 @@ public class AEItemResolver implements ISubItemResolver
{
@Override
public Object resolveItemByName( String nameSpace, String itemName )
public Object resolveItemByName( final String nameSpace, final String itemName )
{
if( nameSpace.equals( AppEng.MOD_ID ) )
@@ -120,8 +120,8 @@ public class AEItemResolver implements ISubItemResolver
if( itemName.startsWith( "ItemMaterial." ) )
{
String materialName = itemName.substring( itemName.indexOf( '.' ) + 1 );
MaterialType mt = MaterialType.valueOf( materialName );
final String materialName = itemName.substring( itemName.indexOf( '.' ) + 1 );
final MaterialType mt = MaterialType.valueOf( materialName );
// itemName = itemName.substring( 0, itemName.indexOf( "." ) );
if( mt.itemInstance == MultiItem.instance && mt.damageValue >= 0 && mt.isRegistered() )
{
@@ -131,10 +131,10 @@ public class AEItemResolver implements ISubItemResolver
if( itemName.startsWith( "ItemPart." ) )
{
String partName = itemName.substring( itemName.indexOf( '.' ) + 1 );
PartType pt = PartType.valueOf( partName );
final String partName = itemName.substring( itemName.indexOf( '.' ) + 1 );
final PartType pt = PartType.valueOf( partName );
// itemName = itemName.substring( 0, itemName.indexOf( "." ) );
int dVal = ItemMultiPart.instance.getDamageByType( pt );
final int dVal = ItemMultiPart.instance.getDamageByType( pt );
if( dVal >= 0 )
{
return new ResolverResult( "ItemMultiPart", dVal );
@@ -145,7 +145,7 @@ public class AEItemResolver implements ISubItemResolver
return null;
}
private Object paintBall( AEColoredItemDefinition partType, String substring, boolean lumen )
private Object paintBall( final AEColoredItemDefinition partType, final String substring, final boolean lumen )
{
AEColor col;
@@ -153,7 +153,7 @@ public class AEItemResolver implements ISubItemResolver
{
col = AEColor.valueOf( substring );
}
catch( Throwable t )
catch( final Throwable t )
{
col = AEColor.Transparent;
}
@@ -163,11 +163,11 @@ public class AEItemResolver implements ISubItemResolver
return null;
}
ItemStack is = partType.stack( col, 1 );
final ItemStack is = partType.stack( col, 1 );
return new ResolverResult( "ItemPaintBall", ( lumen ? 20 : 0 ) + is.getItemDamage() );
}
private Object cableItem( AEColoredItemDefinition partType, String substring )
private Object cableItem( final AEColoredItemDefinition partType, final String substring )
{
AEColor col;
@@ -175,12 +175,12 @@ public class AEItemResolver implements ISubItemResolver
{
col = AEColor.valueOf( substring );
}
catch( Throwable t )
catch( final Throwable t )
{
col = AEColor.Transparent;
}
ItemStack is = partType.stack( col, 1 );
final ItemStack is = partType.stack( col, 1 );
return new ResolverResult( "ItemMultiPart", is.getItemDamage() );
}
}
@@ -43,7 +43,7 @@ public class GroupIngredient implements IIngredient
boolean isInside = false;
public GroupIngredient( String myName, List<IIngredient> ingredients, int qty ) throws RecipeError
public GroupIngredient( final String myName, final List<IIngredient> ingredients, final int qty ) throws RecipeError
{
Preconditions.checkNotNull( myName );
Preconditions.checkNotNull( ingredients );
@@ -53,7 +53,7 @@ public class GroupIngredient implements IIngredient
this.name = myName;
this.qty = qty;
for( IIngredient ingredient : ingredients )
for( final IIngredient ingredient : ingredients )
{
if( ingredient.isAir() )
{
@@ -64,7 +64,7 @@ public class GroupIngredient implements IIngredient
this.ingredients = ingredients;
}
public IIngredient copy( int qty ) throws RecipeError
public IIngredient copy( final int qty ) throws RecipeError
{
Preconditions.checkState( qty > 0 );
return new GroupIngredient( this.name, this.ingredients, qty );
@@ -89,17 +89,17 @@ public class GroupIngredient implements IIngredient
return new ItemStack[0];
}
List<ItemStack> out = new LinkedList<ItemStack>();
final List<ItemStack> out = new LinkedList<ItemStack>();
this.isInside = true;
try
{
for( IIngredient i : this.ingredients )
for( final IIngredient i : this.ingredients )
{
try
{
out.addAll( Arrays.asList( i.getItemStackSet() ) );
}
catch( MissingIngredientError mir )
catch( final MissingIngredientError mir )
{
// oh well this is a group!
}
@@ -115,7 +115,7 @@ public class GroupIngredient implements IIngredient
throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." );
}
for( ItemStack is : out )
for( final ItemStack is : out )
{
is.stackSize = this.qty;
}
+12 -12
View File
@@ -49,7 +49,7 @@ public class Ingredient implements IIngredient
private NBTTagCompound nbt = null;
private ItemStack[] baked;
public Ingredient( RecipeHandler handler, String input, int qty ) throws RecipeError, MissedIngredientSet
public Ingredient( final RecipeHandler handler, final String input, final int qty ) throws RecipeError, MissedIngredientSet
{
Preconditions.checkNotNull( handler );
Preconditions.checkNotNull( input );
@@ -68,7 +68,7 @@ public class Ingredient implements IIngredient
}
this.isAir = false;
String[] parts = input.split( ":" );
final String[] parts = input.split( ":" );
if( parts.length >= 2 )
{
this.nameSpace = handler.alias( parts[0] );
@@ -90,10 +90,10 @@ public class Ingredient implements IIngredient
{
try
{
Object ro = AEApi.instance().registries().recipes().resolveItem( this.nameSpace, tmpName );
final Object ro = AEApi.instance().registries().recipes().resolveItem( this.nameSpace, tmpName );
if( ro instanceof ResolverResult )
{
ResolverResult rr = (ResolverResult) ro;
final ResolverResult rr = (ResolverResult) ro;
tmpName = rr.itemName;
sel = rr.damageValue;
this.nbt = rr.compound;
@@ -103,7 +103,7 @@ public class Ingredient implements IIngredient
throw new MissedIngredientSet( (ResolverResultSet) ro );
}
}
catch( IllegalArgumentException e )
catch( final IllegalArgumentException e )
{
throw new RecipeError( tmpName + " is not a valid ae2 item definition." );
}
@@ -123,7 +123,7 @@ public class Ingredient implements IIngredient
{
this.meta = Integer.parseInt( parts[2] );
}
catch( NumberFormatException e )
catch( final NumberFormatException e )
{
throw new RecipeError( "Invalid Metadata." );
}
@@ -166,7 +166,7 @@ public class Ingredient implements IIngredient
if( blk != null )
{
Item it = Item.getItemFromBlock( blk );
final Item it = Item.getItemFromBlock( blk );
if( it != null )
{
return this.makeItemStack( it, this.qty, this.meta, this.nbt );
@@ -200,9 +200,9 @@ public class Ingredient implements IIngredient
throw new MissingIngredientError( "Unable to find item: " + this.toString() );
}
private ItemStack makeItemStack( Item it, int quantity, int damageValue, NBTTagCompound compound )
private ItemStack makeItemStack( final Item it, final int quantity, final int damageValue, final NBTTagCompound compound )
{
ItemStack is = new ItemStack( it, quantity, damageValue );
final ItemStack is = new ItemStack( it, quantity, damageValue );
is.setTagCompound( compound );
return is;
}
@@ -217,13 +217,13 @@ public class Ingredient implements IIngredient
if( this.nameSpace.equalsIgnoreCase( "oreDictionary" ) )
{
List<ItemStack> ores = OreDictionary.getOres( this.itemName );
ItemStack[] set = ores.toArray( new ItemStack[ores.size()] );
final List<ItemStack> ores = OreDictionary.getOres( this.itemName );
final ItemStack[] set = ores.toArray( new ItemStack[ores.size()] );
// clone and set qty.
for( int x = 0; x < set.length; x++ )
{
ItemStack is = set[x].copy();
final ItemStack is = set[x].copy();
is.stackSize = this.qty;
set[x] = is;
}
@@ -41,7 +41,7 @@ public class IngredientSet implements IIngredient
private final boolean isInside = false;
private ItemStack[] baked;
public IngredientSet( ResolverResultSet rr, int qty )
public IngredientSet( final ResolverResultSet rr, final int qty )
{
Preconditions.checkNotNull( rr );
Preconditions.checkNotNull( rr.name );
@@ -72,7 +72,7 @@ public class IngredientSet implements IIngredient
return new ItemStack[0];
}
List<ItemStack> out = new LinkedList<ItemStack>();
final List<ItemStack> out = new LinkedList<ItemStack>();
out.addAll( this.items );
if( out.isEmpty() )
@@ -80,7 +80,7 @@ public class IngredientSet implements IIngredient
throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." );
}
for( ItemStack is : out )
for( final ItemStack is : out )
{
is.stackSize = this.qty;
}
@@ -28,7 +28,7 @@ public class MissedIngredientSet extends Throwable
private static final long serialVersionUID = 2672951714376345807L;
private final ResolverResultSet resolverResultSet;
public MissedIngredientSet( ResolverResultSet ro )
public MissedIngredientSet( final ResolverResultSet ro )
{
this.resolverResultSet = ro;
}
+68 -68
View File
@@ -84,30 +84,30 @@ public class RecipeHandler implements IRecipeHandler
this.data = new RecipeData();
}
RecipeHandler( RecipeHandler parent )
RecipeHandler( final RecipeHandler parent )
{
Preconditions.checkNotNull( parent );
this.data = parent.data;
}
private void addCrafting( ICraftHandler ch )
private void addCrafting( final ICraftHandler ch )
{
this.data.handlers.add( ch );
}
public String getName( @Nonnull IIngredient i )
public String getName( @Nonnull final IIngredient i )
{
try
{
for( ItemStack is : i.getItemStackSet() )
for( final ItemStack is : i.getItemStackSet() )
{
return this.getName( is );
}
}
catch( RecipeError ignored )
catch( final RecipeError ignored )
{
}
catch( Throwable t )
catch( final Throwable t )
{
t.printStackTrace();
// :P
@@ -116,11 +116,11 @@ public class RecipeHandler implements IRecipeHandler
return i.getNameSpace() + ':' + i.getItemName();
}
public String getName( ItemStack is ) throws RecipeError
public String getName( final ItemStack is ) throws RecipeError
{
Preconditions.checkNotNull( is );
UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() );
final UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() );
String realName = id.modId + ':' + id.name;
if( !id.modId.equals( AppEng.MOD_ID ) && !id.modId.equals( "minecraft" ) )
@@ -140,7 +140,7 @@ public class RecipeHandler implements IRecipeHandler
if( maybeCrystalSeedItem.isPresent() && is.getItem() == maybeCrystalSeedItem.get() )
{
int dmg = is.getItemDamage();
final int dmg = is.getItemDamage();
if( dmg < ItemCrystalSeed.NETHER )
{
realName += ".Certus";
@@ -224,11 +224,11 @@ public class RecipeHandler implements IRecipeHandler
return realName;
}
public String alias( String in )
public String alias( final String in )
{
Preconditions.checkNotNull( in );
String out = this.data.aliases.get( in );
final String out = this.data.aliases.get( in );
if( out != null )
{
@@ -239,7 +239,7 @@ public class RecipeHandler implements IRecipeHandler
}
@Override
public void parseRecipes( IRecipeLoader loader, String path )
public void parseRecipes( final IRecipeLoader loader, final String path )
{
Preconditions.checkNotNull( loader );
Preconditions.checkNotNull( path );
@@ -251,7 +251,7 @@ public class RecipeHandler implements IRecipeHandler
{
reader = loader.getFile( path );
}
catch( Exception err )
catch( final Exception err )
{
AELog.warning( "Error Loading Recipe File:" + path );
if( this.data.exceptions )
@@ -270,7 +270,7 @@ public class RecipeHandler implements IRecipeHandler
int val = -1;
while( ( val = reader.read() ) != -1 )
{
char c = (char) val;
final char c = (char) val;
if( c == '\n' )
{
@@ -354,7 +354,7 @@ public class RecipeHandler implements IRecipeHandler
reader.close();
this.processTokens( loader, path, line );
}
catch( Throwable e )
catch( final Throwable e )
{
AELog.error( e );
if( this.data.crash )
@@ -372,17 +372,17 @@ public class RecipeHandler implements IRecipeHandler
throw new IllegalStateException( "Recipes must now be loaded in Init." );
}
Map<Class, Integer> processed = new HashMap<Class, Integer>();
final Map<Class, Integer> processed = new HashMap<Class, Integer>();
try
{
for( ICraftHandler ch : this.data.handlers )
for( final ICraftHandler ch : this.data.handlers )
{
try
{
ch.register();
Class clz = ch.getClass();
Integer i = processed.get( clz );
final Class clz = ch.getClass();
final Integer i = processed.get( clz );
if( i == null )
{
processed.put( clz, 1 );
@@ -392,7 +392,7 @@ public class RecipeHandler implements IRecipeHandler
processed.put( clz, i + 1 );
}
}
catch( RegistrationError e )
catch( final RegistrationError e )
{
AELog.warning( "Unable to register a recipe: " + e.getMessage() );
if( this.data.exceptions )
@@ -404,7 +404,7 @@ public class RecipeHandler implements IRecipeHandler
throw e;
}
}
catch( MissingIngredientError e )
catch( final MissingIngredientError e )
{
if( this.data.errorOnMissing )
{
@@ -421,7 +421,7 @@ public class RecipeHandler implements IRecipeHandler
}
}
}
catch( Throwable e )
catch( final Throwable e )
{
if( this.data.exceptions )
{
@@ -433,7 +433,7 @@ public class RecipeHandler implements IRecipeHandler
}
}
for( Entry<Class, Integer> e : processed.entrySet() )
for( final Entry<Class, Integer> e : processed.entrySet() )
{
AELog.info( "Recipes Loading: " + e.getKey().getSimpleName() + ": " + e.getValue() + " loaded." );
}
@@ -442,52 +442,52 @@ public class RecipeHandler implements IRecipeHandler
{
try
{
ZipOutputStream out = new ZipOutputStream( new FileOutputStream( "recipes.zip" ) );
final ZipOutputStream out = new ZipOutputStream( new FileOutputStream( "recipes.zip" ) );
HashMultimap<String, IWebsiteSerializer> combined = HashMultimap.create();
final HashMultimap<String, IWebsiteSerializer> combined = HashMultimap.create();
for( String s : this.data.knownItem )
for( final String s : this.data.knownItem )
{
try
{
IIngredient i = new Ingredient( this, s, 1 );
final IIngredient i = new Ingredient( this, s, 1 );
for( ItemStack is : i.getItemStackSet() )
for( final ItemStack is : i.getItemStackSet() )
{
String realName = this.getName( is );
List<IWebsiteSerializer> recipes = this.findRecipe( is );
final String realName = this.getName( is );
final List<IWebsiteSerializer> recipes = this.findRecipe( is );
if( !recipes.isEmpty() )
{
combined.putAll( realName, recipes );
}
}
}
catch( RecipeError ignored )
catch( final RecipeError ignored )
{
}
catch( MissedIngredientSet ignored )
catch( final MissedIngredientSet ignored )
{
}
catch( RegistrationError ignored )
catch( final RegistrationError ignored )
{
}
catch( MissingIngredientError ignored )
catch( final MissingIngredientError ignored )
{
}
}
for( String realName : combined.keySet() )
for( final String realName : combined.keySet() )
{
int offset = 0;
for( IWebsiteSerializer ws : combined.get( realName ) )
for( final IWebsiteSerializer ws : combined.get( realName ) )
{
String rew = ws.getPattern( this );
final String rew = ws.getPattern( this );
if( rew != null && rew.length() > 0 )
{
out.putNextEntry( new ZipEntry( realName + '_' + offset + ".txt" ) );
@@ -499,22 +499,22 @@ public class RecipeHandler implements IRecipeHandler
out.close();
}
catch( FileNotFoundException e1 )
catch( final FileNotFoundException e1 )
{
AELog.error( e1 );
}
catch( IOException e1 )
catch( final IOException e1 )
{
AELog.error( e1 );
}
}
}
public List<IWebsiteSerializer> findRecipe( ItemStack output )
public List<IWebsiteSerializer> findRecipe( final ItemStack output )
{
List<IWebsiteSerializer> out = new LinkedList<IWebsiteSerializer>();
final List<IWebsiteSerializer> out = new LinkedList<IWebsiteSerializer>();
for( ICraftHandler ch : this.data.handlers )
for( final ICraftHandler ch : this.data.handlers )
{
try
{
@@ -523,7 +523,7 @@ public class RecipeHandler implements IRecipeHandler
out.add( (IWebsiteSerializer) ch );
}
}
catch( Throwable t )
catch( final Throwable t )
{
AELog.error( t );
}
@@ -537,18 +537,18 @@ public class RecipeHandler implements IRecipeHandler
return this.data;
}
private void processTokens( IRecipeLoader loader, String file, int line ) throws RecipeError
private void processTokens( final IRecipeLoader loader, final String file, final int line ) throws RecipeError
{
try
{
IRecipeHandlerRegistry cr = AEApi.instance().registries().recipes();
final IRecipeHandlerRegistry cr = AEApi.instance().registries().recipes();
if( this.tokens.isEmpty() )
{
return;
}
int split = this.tokens.indexOf( "->" );
final int split = this.tokens.indexOf( "->" );
if( split != -1 )
{
final String operation = this.tokens.remove( 0 ).toLowerCase( Locale.ENGLISH );
@@ -566,10 +566,10 @@ public class RecipeHandler implements IRecipeHandler
}
else if( operation.equals( "group" ) )
{
List<String> pre = this.tokens.subList( 0, split - 1 );
List<String> post = this.tokens.subList( split, this.tokens.size() );
final List<String> pre = this.tokens.subList( 0, split - 1 );
final List<String> post = this.tokens.subList( split, this.tokens.size() );
List<List<IIngredient>> inputs = this.parseLines( pre );
final List<List<IIngredient>> inputs = this.parseLines( pre );
if( inputs.size() == 1 && inputs.get( 0 ).size() > 0 && post.size() == 1 )
{
@@ -582,14 +582,14 @@ public class RecipeHandler implements IRecipeHandler
}
else if( operation.equals( "ore" ) )
{
List<String> pre = this.tokens.subList( 0, split - 1 );
List<String> post = this.tokens.subList( split, this.tokens.size() );
final List<String> pre = this.tokens.subList( 0, split - 1 );
final List<String> post = this.tokens.subList( split, this.tokens.size() );
List<List<IIngredient>> inputs = this.parseLines( pre );
final List<List<IIngredient>> inputs = this.parseLines( pre );
if( inputs.size() == 1 && inputs.get( 0 ).size() > 0 && post.size() == 1 )
{
ICraftHandler ch = new OreRegistration( inputs.get( 0 ), post.get( 0 ) );
final ICraftHandler ch = new OreRegistration( inputs.get( 0 ), post.get( 0 ) );
this.addCrafting( ch );
}
else
@@ -599,13 +599,13 @@ public class RecipeHandler implements IRecipeHandler
}
else
{
List<String> pre = this.tokens.subList( 0, split - 1 );
List<String> post = this.tokens.subList( split, this.tokens.size() );
final List<String> pre = this.tokens.subList( 0, split - 1 );
final List<String> post = this.tokens.subList( split, this.tokens.size() );
List<List<IIngredient>> inputs = this.parseLines( pre );
List<List<IIngredient>> outputs = this.parseLines( post );
final List<List<IIngredient>> inputs = this.parseLines( pre );
final List<List<IIngredient>> outputs = this.parseLines( post );
ICraftHandler ch = cr.getCraftHandlerFor( operation );
final ICraftHandler ch = cr.getCraftHandlerFor( operation );
if( ch != null )
{
@@ -620,7 +620,7 @@ public class RecipeHandler implements IRecipeHandler
}
else
{
String operation = this.tokens.remove( 0 ).toLowerCase();
final String operation = this.tokens.remove( 0 ).toLowerCase();
if( operation.equals( "exceptions" ) && ( this.tokens.get( 0 ).equals( "true" ) || this.tokens.get( 0 ).equals( "false" ) ) )
{
@@ -672,7 +672,7 @@ public class RecipeHandler implements IRecipeHandler
}
}
}
catch( RecipeError e )
catch( final RecipeError e )
{
AELog.warning( "Recipe Error '" + e.getMessage() + "' near line:" + line + " in " + file + " with: " + this.tokens.toString() );
if( this.data.exceptions )
@@ -688,15 +688,15 @@ public class RecipeHandler implements IRecipeHandler
this.tokens.clear();
}
private List<List<IIngredient>> parseLines( Iterable<String> subList ) throws RecipeError
private List<List<IIngredient>> parseLines( final Iterable<String> subList ) throws RecipeError
{
List<List<IIngredient>> out = new LinkedList<List<IIngredient>>();
final List<List<IIngredient>> out = new LinkedList<List<IIngredient>>();
List<IIngredient> cList = new LinkedList<IIngredient>();
boolean hasQty = false;
int qty = 1;
for( String v : subList )
for( final String v : subList )
{
if( v.equals( "," ) )
{
@@ -744,9 +744,9 @@ public class RecipeHandler implements IRecipeHandler
return out;
}
private IIngredient findIngredient( String v, int qty ) throws RecipeError
private IIngredient findIngredient( final String v, final int qty ) throws RecipeError
{
GroupIngredient gi = this.data.groups.get( v );
final GroupIngredient gi = this.data.groups.get( v );
if( gi != null )
{
@@ -757,20 +757,20 @@ public class RecipeHandler implements IRecipeHandler
{
return new Ingredient( this, v, qty );
}
catch( MissedIngredientSet grp )
catch( final MissedIngredientSet grp )
{
return new IngredientSet( grp.getResolverResultSet(), qty );
}
}
private boolean isNumber( CharSequence v )
private boolean isNumber( final CharSequence v )
{
if( v.length() <= 0 )
{
return false;
}
int l = v.length();
final int l = v.length();
for( int x = 0; x < l; x++ )
{
if( !Character.isDigit( v.charAt( x ) ) )
@@ -75,20 +75,20 @@ public final class DisassembleRecipe implements IRecipe
}
@Override
public boolean matches( InventoryCrafting inv, World w )
public boolean matches( final InventoryCrafting inv, final World w )
{
return this.getOutput( inv ) != null;
}
@Nullable
private ItemStack getOutput( IInventory inventory )
private ItemStack getOutput( final IInventory inventory )
{
int itemCount = 0;
ItemStack output = MISMATCHED_STACK;
for( int slotIndex = 0; slotIndex < inventory.getSizeInventory(); slotIndex++ )
{
ItemStack stackInSlot = inventory.getStackInSlot( slotIndex );
final ItemStack stackInSlot = inventory.getStackInSlot( slotIndex );
if( stackInSlot != null )
{
// needs a single input in the recipe
@@ -99,13 +99,13 @@ public final class DisassembleRecipe implements IRecipe
}
// handle storage cells
for( ItemStack storageCellStack : this.getCellOutput( stackInSlot ).asSet() )
for( final ItemStack storageCellStack : this.getCellOutput( stackInSlot ).asSet() )
{
// make sure the storage cell stackInSlot empty...
IMEInventory<IAEItemStack> cellInv = AEApi.instance().registries().cell().getCellInventory( stackInSlot, null, StorageChannel.ITEMS );
final IMEInventory<IAEItemStack> cellInv = AEApi.instance().registries().cell().getCellInventory( stackInSlot, null, StorageChannel.ITEMS );
if( cellInv != null )
{
IItemList<IAEItemStack> list = cellInv.getAvailableItems( StorageChannel.ITEMS.createList() );
final IItemList<IAEItemStack> list = cellInv.getAvailableItems( StorageChannel.ITEMS.createList() );
if( !list.isEmpty() )
{
return null;
@@ -116,7 +116,7 @@ public final class DisassembleRecipe implements IRecipe
}
// handle crafting storage blocks
for( ItemStack craftingStorageStack : this.getNonCellOutput( stackInSlot ).asSet() )
for( final ItemStack craftingStorageStack : this.getNonCellOutput( stackInSlot ).asSet() )
{
output = craftingStorageStack;
}
@@ -127,9 +127,9 @@ public final class DisassembleRecipe implements IRecipe
}
@Nonnull
private Optional<ItemStack> getCellOutput( ItemStack compared )
private Optional<ItemStack> getCellOutput( final ItemStack compared )
{
for( Map.Entry<IItemDefinition, IItemDefinition> entry : this.cellMappings.entrySet() )
for( final Map.Entry<IItemDefinition, IItemDefinition> entry : this.cellMappings.entrySet() )
{
if( entry.getKey().isSameAs( compared ) )
{
@@ -141,9 +141,9 @@ public final class DisassembleRecipe implements IRecipe
}
@Nonnull
private Optional<ItemStack> getNonCellOutput( ItemStack compared )
private Optional<ItemStack> getNonCellOutput( final ItemStack compared )
{
for( Map.Entry<IItemDefinition, IItemDefinition> entry : this.nonCellMappings.entrySet() )
for( final Map.Entry<IItemDefinition, IItemDefinition> entry : this.nonCellMappings.entrySet() )
{
if( entry.getKey().isSameAs( compared ) )
{
@@ -156,7 +156,7 @@ public final class DisassembleRecipe implements IRecipe
@Nullable
@Override
public ItemStack getCraftingResult( InventoryCrafting inv )
public ItemStack getCraftingResult( final InventoryCrafting inv )
{
return this.getOutput( inv );
}
@@ -176,7 +176,7 @@ public final class DisassembleRecipe implements IRecipe
@Override
public ItemStack[] getRemainingItems(
InventoryCrafting inv )
final InventoryCrafting inv )
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
@@ -50,23 +50,23 @@ public final class FacadeRecipe implements IRecipe
}
@Override
public boolean matches( InventoryCrafting inv, World w )
public boolean matches( final InventoryCrafting inv, final World w )
{
return this.getOutput( inv, false ) != null;
}
@Nullable
private ItemStack getOutput( IInventory inv, boolean createFacade )
private ItemStack getOutput( final IInventory inv, final boolean createFacade )
{
if( inv.getStackInSlot( 0 ) == null && inv.getStackInSlot( 2 ) == null && inv.getStackInSlot( 6 ) == null && inv.getStackInSlot( 8 ) == null )
{
if( this.anchor.isSameAs( inv.getStackInSlot( 1 ) ) && this.anchor.isSameAs( inv.getStackInSlot( 3 ) ) && this.anchor.isSameAs( inv.getStackInSlot( 5 ) ) && this.anchor.isSameAs( inv.getStackInSlot( 7 ) ) )
{
for( Item facadeItemDefinition : this.maybeFacade.asSet() )
for( final Item facadeItemDefinition : this.maybeFacade.asSet() )
{
final ItemFacade facade = (ItemFacade) facadeItemDefinition;
ItemStack facades = facade.createFacadeForItem( inv.getStackInSlot( 4 ), !createFacade );
final ItemStack facades = facade.createFacadeForItem( inv.getStackInSlot( 4 ), !createFacade );
if( facades != null && createFacade )
{
facades.stackSize = 4;
@@ -80,7 +80,7 @@ public final class FacadeRecipe implements IRecipe
}
@Override
public ItemStack getCraftingResult( InventoryCrafting inv )
public ItemStack getCraftingResult( final InventoryCrafting inv )
{
return this.getOutput( inv, true );
}
@@ -99,7 +99,7 @@ public final class FacadeRecipe implements IRecipe
@Override
public ItemStack[] getRemainingItems(
InventoryCrafting inv )
final InventoryCrafting inv )
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
@@ -47,11 +47,11 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
private boolean mirrored = true;
private boolean disable = false;
public ShapedRecipe( ItemStack result, Object... recipe )
public ShapedRecipe( final ItemStack result, Object... recipe )
{
this.output = result.copy();
StringBuilder shape = new StringBuilder();
final StringBuilder shape = new StringBuilder();
int idx = 0;
if( recipe[idx] instanceof Boolean )
@@ -69,10 +69,10 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
if( recipe[idx] instanceof String[] )
{
String[] parts = ( (String[]) recipe[idx] );
final String[] parts = ( (String[]) recipe[idx] );
idx++;
for( String s : parts )
for( final String s : parts )
{
this.width = s.length();
shape.append( s );
@@ -84,7 +84,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
{
while( recipe[idx] instanceof String )
{
String s = (String) recipe[idx];
final String s = (String) recipe[idx];
idx++;
shape.append( s );
this.width = s.length();
@@ -94,8 +94,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
if( this.width * this.height != shape.length() )
{
StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " );
for( Object tmp : recipe )
final StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " );
for( final Object tmp : recipe )
{
ret.append( tmp ).append( ", " );
}
@@ -103,12 +103,12 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
throw new IllegalStateException( ret.toString() );
}
Map<Character, IIngredient> itemMap = new HashMap<Character, IIngredient>();
final Map<Character, IIngredient> itemMap = new HashMap<Character, IIngredient>();
for(; idx < recipe.length; idx += 2 )
{
Character chr = (Character) recipe[idx];
Object in = recipe[idx + 1];
final Character chr = (Character) recipe[idx];
final Object in = recipe[idx + 1];
if( in instanceof IIngredient )
{
@@ -116,8 +116,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
}
else
{
StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " );
for( Object tmp : recipe )
final StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " );
for( final Object tmp : recipe )
{
ret.append( tmp ).append( ", " );
}
@@ -128,7 +128,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
this.input = new Object[this.width * this.height];
int x = 0;
for( char chr : shape.toString().toCharArray() )
for( final char chr : shape.toString().toCharArray() )
{
this.input[x] = itemMap.get( chr );
x++;
@@ -141,7 +141,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
}
@Override
public boolean matches( InventoryCrafting inv, World world )
public boolean matches( final InventoryCrafting inv, final World world )
{
if( this.disable )
{
@@ -168,7 +168,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
}
@Override
public ItemStack getCraftingResult( InventoryCrafting var1 )
public ItemStack getCraftingResult( final InventoryCrafting var1 )
{
return this.output.copy();
}
@@ -186,7 +186,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
}
@SuppressWarnings( "unchecked" )
private boolean checkMatch( InventoryCrafting inv, int startX, int startY, boolean mirror )
private boolean checkMatch( final InventoryCrafting inv, final int startX, final int startY, final boolean mirror )
{
if( this.disable )
{
@@ -197,8 +197,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
{
for( int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++ )
{
int subX = x - startX;
int subY = y - startY;
final int subX = x - startX;
final int subY = y - startY;
Object target = null;
if( subX >= 0 && subY >= 0 && subX < this.width && subY < this.height )
@@ -213,7 +213,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
}
}
ItemStack slot = inv.getStackInRowAndColumn( x, y );
final ItemStack slot = inv.getStackInRowAndColumn( x, y );
if( target instanceof IIngredient )
{
@@ -221,16 +221,16 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
try
{
for( ItemStack item : ( (IIngredient) target ).getItemStackSet() )
for( final ItemStack item : ( (IIngredient) target ).getItemStackSet() )
{
matched = matched || this.checkItemEquals( item, slot );
}
}
catch( RegistrationError e )
catch( final RegistrationError e )
{
// :P
}
catch( MissingIngredientError e )
catch( final MissingIngredientError e )
{
// :P
}
@@ -244,7 +244,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
{
boolean matched = false;
for( ItemStack item : (Iterable<ItemStack>) target )
for( final ItemStack item : (Iterable<ItemStack>) target )
{
matched = matched || this.checkItemEquals( item, slot );
}
@@ -264,7 +264,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
return true;
}
private boolean checkItemEquals( ItemStack target, ItemStack input )
private boolean checkItemEquals( final ItemStack target, final ItemStack input )
{
if( input == null && target != null || input != null && target == null )
{
@@ -273,7 +273,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
return ( target.getItem() == input.getItem() && ( target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage() ) );
}
public ShapedRecipe setMirrored( boolean mirror )
public ShapedRecipe setMirrored( final boolean mirror )
{
this.mirrored = mirror;
return this;
@@ -311,7 +311,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
try
{
this.disable = false;
for( Object o : this.input )
for( final Object o : this.input )
{
if( o instanceof IIngredient )
{
@@ -319,7 +319,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
}
}
}
catch( MissingIngredientError err )
catch( final MissingIngredientError err )
{
this.disable = true;
}
@@ -327,7 +327,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
@Override
public ItemStack[] getRemainingItems(
InventoryCrafting inv )
final InventoryCrafting inv )
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
@@ -39,10 +39,10 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
private ItemStack output = null;
private boolean disable = false;
public ShapelessRecipe( ItemStack result, Object... recipe )
public ShapelessRecipe( final ItemStack result, final Object... recipe )
{
this.output = result.copy();
for( Object in : recipe )
for( final Object in : recipe )
{
if( in instanceof IIngredient )
{
@@ -50,8 +50,8 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
}
else
{
StringBuilder ret = new StringBuilder( "Invalid shapeless ore recipe: " );
for( Object tmp : recipe )
final StringBuilder ret = new StringBuilder( "Invalid shapeless ore recipe: " );
for( final Object tmp : recipe )
{
ret.append( tmp ).append( ", " );
}
@@ -68,24 +68,24 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
@SuppressWarnings( "unchecked" )
@Override
public boolean matches( InventoryCrafting var1, World world )
public boolean matches( final InventoryCrafting var1, final World world )
{
if( this.disable )
{
return false;
}
ArrayList<Object> required = new ArrayList<Object>( this.input );
final ArrayList<Object> required = new ArrayList<Object>( this.input );
for( int x = 0; x < var1.getSizeInventory(); x++ )
{
ItemStack slot = var1.getStackInSlot( x );
final ItemStack slot = var1.getStackInSlot( x );
if( slot != null )
{
boolean inRecipe = false;
for( Object next : required )
for( final Object next : required )
{
boolean match = false;
@@ -93,16 +93,16 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
{
try
{
for( ItemStack item : ( (IIngredient) next ).getItemStackSet() )
for( final ItemStack item : ( (IIngredient) next ).getItemStackSet() )
{
match = match || this.checkItemEquals( item, slot );
}
}
catch( RegistrationError e )
catch( final RegistrationError e )
{
// :P
}
catch( MissingIngredientError e )
catch( final MissingIngredientError e )
{
// :P
}
@@ -127,7 +127,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
}
@Override
public ItemStack getCraftingResult( InventoryCrafting var1 )
public ItemStack getCraftingResult( final InventoryCrafting var1 )
{
return this.output.copy();
}
@@ -144,7 +144,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
return this.output;
}
private boolean checkItemEquals( ItemStack target, ItemStack input )
private boolean checkItemEquals( final ItemStack target, final ItemStack input )
{
return ( target.getItem() == input.getItem() && ( target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage() ) );
}
@@ -166,7 +166,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
try
{
this.disable = false;
for( Object o : this.input )
for( final Object o : this.input )
{
if( o instanceof IIngredient )
{
@@ -174,7 +174,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
}
}
}
catch( MissingIngredientError e )
catch( final MissingIngredientError e )
{
this.disable = true;
}
@@ -182,7 +182,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
@Override
public ItemStack[] getRemainingItems(
InventoryCrafting inv )
final InventoryCrafting inv )
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
@@ -42,11 +42,11 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer
IIngredient[] pro_output;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( input.size() == 1 && output.size() == 1 )
{
int outs = output.get( 0 ).size();
final int outs = output.get( 0 ).size();
if( input.get( 0 ).size() == 1 && outs == 1 )
{
this.pro_input = input.get( 0 ).get( 0 );
@@ -62,14 +62,14 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer
{
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.RC ) )
{
IRC rc = (IRC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.RC );
for( ItemStack is : this.pro_input.getItemStackSet() )
final IRC rc = (IRC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.RC );
for( final ItemStack is : this.pro_input.getItemStackSet() )
{
try
{
rc.rockCrusher( is, this.pro_output[0].getItemStack() );
}
catch( java.lang.RuntimeException err )
catch( final java.lang.RuntimeException err )
{
AELog.info( "RC not happy - " + err.getMessage() );
}
@@ -78,13 +78,13 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer
}
@Override
public String getPattern( RecipeHandler h )
public String getPattern( final RecipeHandler h )
{
return null;
}
@Override
public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError
{
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
}
@@ -39,11 +39,11 @@ public class Grind implements ICraftHandler, IWebsiteSerializer
IIngredient[] pro_output;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( input.size() == 1 && output.size() == 1 )
{
int outs = output.get( 0 ).size();
final int outs = output.get( 0 ).size();
if( input.get( 0 ).size() == 1 && outs == 1 )
{
this.pro_input = input.get( 0 ).get( 0 );
@@ -57,14 +57,14 @@ public class Grind implements ICraftHandler, IWebsiteSerializer
@Override
public void register() throws RegistrationError, MissingIngredientError
{
for( ItemStack is : this.pro_input.getItemStackSet() )
for( final ItemStack is : this.pro_input.getItemStackSet() )
{
AEApi.instance().registries().grinder().addRecipe( is, this.pro_output[0].getItemStack(), 8 );
}
}
@Override
public String getPattern( RecipeHandler h )
public String getPattern( final RecipeHandler h )
{
return "grind\n" +
h.getName( this.pro_input ) + '\n' +
@@ -72,7 +72,7 @@ public class Grind implements ICraftHandler, IWebsiteSerializer
}
@Override
public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError
{
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
}
@@ -42,11 +42,11 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer
IIngredient[] pro_output;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( input.size() == 1 && output.size() == 1 )
{
int outs = output.get( 0 ).size();
final int outs = output.get( 0 ).size();
if( input.get( 0 ).size() == 1 && outs == 1 )
{
this.pro_input = input.get( 0 ).get( 0 );
@@ -62,14 +62,14 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer
{
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FZ ) )
{
IFZ fz = (IFZ) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FZ );
for( ItemStack is : this.pro_input.getItemStackSet() )
final IFZ fz = (IFZ) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FZ );
for( final ItemStack is : this.pro_input.getItemStackSet() )
{
try
{
fz.grinderRecipe( is, this.pro_output[0].getItemStack() );
}
catch( java.lang.RuntimeException err )
catch( final java.lang.RuntimeException err )
{
AELog.info( "FZ not happy - " + err.getMessage() );
}
@@ -78,13 +78,13 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer
}
@Override
public String getPattern( RecipeHandler h )
public String getPattern( final RecipeHandler h )
{
return null;
}
@Override
public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError
{
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
}
@@ -41,11 +41,11 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer
IIngredient[] pro_output;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( input.size() == 1 && output.size() == 1 )
{
int outs = output.get( 0 ).size();
final int outs = output.get( 0 ).size();
if( input.get( 0 ).size() == 1 && outs == 1 )
{
this.pro_input = input.get( 0 ).get( 0 );
@@ -59,16 +59,16 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer
@Override
public void register() throws RegistrationError, MissingIngredientError
{
for( ItemStack beginStack : this.pro_input.getItemStackSet() )
for( final ItemStack beginStack : this.pro_input.getItemStackSet() )
{
try
{
NBTTagCompound toRegister = new NBTTagCompound();
final NBTTagCompound toRegister = new NBTTagCompound();
ItemStack endStack = this.pro_output[0].getItemStack();
final ItemStack endStack = this.pro_output[0].getItemStack();
NBTTagCompound itemFrom = new NBTTagCompound();
NBTTagCompound itemTo = new NBTTagCompound();
final NBTTagCompound itemFrom = new NBTTagCompound();
final NBTTagCompound itemTo = new NBTTagCompound();
beginStack.writeToNBT( itemFrom );
endStack.writeToNBT( itemTo );
@@ -79,7 +79,7 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer
FMLInterModComms.sendMessage( "HydCraft", "registerCrushingRecipe", toRegister );
}
catch( java.lang.RuntimeException err )
catch( final java.lang.RuntimeException err )
{
AELog.info( "Hydraulicraft not happy - " + err.getMessage() );
}
@@ -87,13 +87,13 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer
}
@Override
public String getPattern( RecipeHandler h )
public String getPattern( final RecipeHandler h )
{
return null;
}
@Override
public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError
{
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
}
@@ -62,7 +62,7 @@ public final class Inscribe extends InscriberProcess
final ItemStack output = this.getOutput().getItemStack();
final InscriberProcessType type = InscriberProcessType.Inscribe;
IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type );
final IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type );
AEApi.instance().registries().inscriber().addRecipe( recipe );
}
@@ -38,7 +38,7 @@ public abstract class InscriberProcess implements ICraftHandler, IWebsiteSeriali
private IIngredient output;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( output.size() == 1 && output.get( 0 ).size() == 1 )
{
@@ -67,13 +67,13 @@ public abstract class InscriberProcess implements ICraftHandler, IWebsiteSeriali
}
@Override
public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError
{
return this.output != null && Platform.isSameItemPrecise( this.output.getItemStack(), reqOutput );
}
@Override
public String getPattern( RecipeHandler handler )
public String getPattern( final RecipeHandler handler )
{
String pattern = "inscriber ";
@@ -42,11 +42,11 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer
IIngredient[] pro_output;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( input.size() == 1 && output.size() == 1 )
{
int outs = output.get( 0 ).size();
final int outs = output.get( 0 ).size();
if( input.get( 0 ).size() == 1 && outs == 1 )
{
this.pro_input = input.get( 0 ).get( 0 );
@@ -62,14 +62,14 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer
{
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) )
{
IIC2 ic2 = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 );
for( ItemStack is : this.pro_input.getItemStackSet() )
final IIC2 ic2 = (IIC2) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.IC2 );
for( final ItemStack is : this.pro_input.getItemStackSet() )
{
try
{
ic2.maceratorRecipe( is, this.pro_output[0].getItemStack() );
}
catch( java.lang.RuntimeException err )
catch( final java.lang.RuntimeException err )
{
AELog.info( "IC2 not happy - " + err.getMessage() );
}
@@ -78,13 +78,13 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer
}
@Override
public String getPattern( RecipeHandler h )
public String getPattern( final RecipeHandler h )
{
return null;
}
@Override
public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError
{
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
}
@@ -42,11 +42,11 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer
IIngredient[] pro_output;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( input.size() == 1 && output.size() == 1 )
{
int outs = output.get( 0 ).size();
final int outs = output.get( 0 ).size();
if( input.get( 0 ).size() == 1 && outs == 1 )
{
this.pro_input = input.get( 0 ).get( 0 );
@@ -63,14 +63,14 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer
{
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.Mekanism ) )
{
IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism );
for( ItemStack is : this.pro_input.getItemStackSet() )
final IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism );
for( final ItemStack is : this.pro_input.getItemStackSet() )
{
try
{
rc.addCrusherRecipe( is, this.pro_output[0].getItemStack() );
}
catch( java.lang.RuntimeException err )
catch( final java.lang.RuntimeException err )
{
AELog.info( "Mekanism not happy - " + err.getMessage() );
}
@@ -79,13 +79,13 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer
}
@Override
public String getPattern( RecipeHandler h )
public String getPattern( final RecipeHandler h )
{
return null;
}
@Override
public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError
{
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
}
@@ -42,11 +42,11 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer
IIngredient[] pro_output;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( input.size() == 1 && output.size() == 1 )
{
int outs = output.get( 0 ).size();
final int outs = output.get( 0 ).size();
if( input.get( 0 ).size() == 1 && outs == 1 )
{
this.pro_input = input.get( 0 ).get( 0 );
@@ -62,14 +62,14 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer
{
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.Mekanism ) )
{
IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism );
for( ItemStack is : this.pro_input.getItemStackSet() )
final IMekanism rc = (IMekanism) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.Mekanism );
for( final ItemStack is : this.pro_input.getItemStackSet() )
{
try
{
rc.addEnrichmentChamberRecipe( is, this.pro_output[0].getItemStack() );
}
catch( java.lang.RuntimeException err )
catch( final java.lang.RuntimeException err )
{
AELog.info( "Mekanism not happy - " + err.getMessage() );
}
@@ -78,13 +78,13 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer
}
@Override
public String getPattern( RecipeHandler h )
public String getPattern( final RecipeHandler h )
{
return null;
}
@Override
public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError
{
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
}
@@ -36,14 +36,14 @@ public class OreRegistration implements ICraftHandler
final List<IIngredient> inputs;
final String name;
public OreRegistration( List<IIngredient> in, String out )
public OreRegistration( final List<IIngredient> in, final String out )
{
this.inputs = in;
this.name = out;
}
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
}
@@ -51,9 +51,9 @@ public class OreRegistration implements ICraftHandler
@Override
public void register() throws RegistrationError, MissingIngredientError
{
for( IIngredient i : this.inputs )
for( final IIngredient i : this.inputs )
{
for( ItemStack is : i.getItemStackSet() )
for( final ItemStack is : i.getItemStackSet() )
{
OreDictionary.registerOre( this.name, is );
}
@@ -62,7 +62,7 @@ public final class Press extends InscriberProcess
final ItemStack output = this.getOutput().getItemStack();
final InscriberProcessType type = InscriberProcessType.Press;
IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type );
final IInscriberRecipe recipe = new InscriberRecipe( inputs, output, top, bot, type );
AEApi.instance().registries().inscriber().addRecipe( recipe );
}
@@ -40,11 +40,11 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer
IIngredient[] pro_output;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( input.size() == 1 && output.size() == 1 )
{
int outs = output.get( 0 ).size();
final int outs = output.get( 0 ).size();
if( input.get( 0 ).size() == 1 && outs == 1 )
{
this.pro_input = input.get( 0 ).get( 0 );
@@ -58,13 +58,13 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer
@Override
public void register() throws RegistrationError, MissingIngredientError
{
NBTTagCompound toSend = new NBTTagCompound();
final NBTTagCompound toSend = new NBTTagCompound();
toSend.setInteger( "energy", 800 );
toSend.setTag( "primaryOutput", new NBTTagCompound() );
this.pro_output[0].getItemStack().writeToNBT( toSend.getCompoundTag( "primaryOutput" ) );
for( ItemStack is : this.pro_input.getItemStackSet() )
for( final ItemStack is : this.pro_input.getItemStackSet() )
{
toSend.setTag( "input", new NBTTagCompound() );
is.writeToNBT( toSend.getCompoundTag( "input" ) );
@@ -73,13 +73,13 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer
}
@Override
public String getPattern( RecipeHandler h )
public String getPattern( final RecipeHandler h )
{
return null;
}
@Override
public boolean canCraft( ItemStack output ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack output ) throws RegistrationError, MissingIngredientError
{
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
}
@@ -44,7 +44,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
private int cols;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( output.size() == 1 && output.get( 0 ).size() == 1 )
{
@@ -54,7 +54,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
this.cols = input.get( 0 ).size();
if( this.cols <= 3 && this.cols >= 1 )
{
for( List<IIngredient> anInput : input )
for( final List<IIngredient> anInput : input )
{
if( anInput.size() != this.cols )
{
@@ -85,11 +85,11 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
public void register() throws RegistrationError, MissingIngredientError
{
char first = 'A';
List<Object> args = new ArrayList<Object>();
final List<Object> args = new ArrayList<Object>();
for( int y = 0; y < this.rows; y++ )
{
StringBuilder row = new StringBuilder();
final StringBuilder row = new StringBuilder();
for( int x = 0; x < this.cols; x++ )
{
if( this.inputs.get( y ).get( x ).isAir() )
@@ -108,13 +108,13 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
args.add( y, row.toString() );
}
ItemStack outIS = this.output.getItemStack();
final ItemStack outIS = this.output.getItemStack();
try
{
GameRegistry.addRecipe( new ShapedRecipe( outIS, args.toArray( new Object[args.size()] ) ) );
}
catch( Throwable e )
catch( final Throwable e )
{
AELog.error( e );
throw new RegistrationError( "Error while adding shaped recipe." );
@@ -122,7 +122,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
}
@Override
public String getPattern( RecipeHandler h )
public String getPattern( final RecipeHandler h )
{
String o = "shaped " + this.output.getQty() + ' ' + this.cols + 'x' + this.rows + '\n';
@@ -132,7 +132,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
{
for( int x = 0; x < this.cols; x++ )
{
IIngredient i = this.inputs.get( y ).get( x );
final IIngredient i = this.inputs.get( y ).get( x );
if( i.isAir() )
{
@@ -149,17 +149,17 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
}
@Override
public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError
{
for( int y = 0; y < this.rows; y++ )
{
for( int x = 0; x < this.cols; x++ )
{
IIngredient i = this.inputs.get( y ).get( x );
final IIngredient i = this.inputs.get( y ).get( x );
if( !i.isAir() )
{
for( ItemStack r : i.getItemStackSet() )
for( final ItemStack r : i.getItemStackSet() )
{
if( Platform.isSameItemPrecise( r, reqOutput ) )
{
@@ -42,7 +42,7 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer
IIngredient output;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( output.size() == 1 && output.get( 0 ).size() == 1 )
{
@@ -65,19 +65,19 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer
@Override
public void register() throws RegistrationError, MissingIngredientError
{
List<Object> args = new ArrayList<Object>();
for( IIngredient i : this.inputs )
final List<Object> args = new ArrayList<Object>();
for( final IIngredient i : this.inputs )
{
args.add( i );
}
ItemStack outIS = this.output.getItemStack();
final ItemStack outIS = this.output.getItemStack();
try
{
GameRegistry.addRecipe( new ShapelessRecipe( outIS, args.toArray( new Object[args.size()] ) ) );
}
catch( Throwable e )
catch( final Throwable e )
{
AELog.error( e );
throw new RegistrationError( "Error while adding shapeless recipe." );
@@ -85,15 +85,15 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer
}
@Override
public String getPattern( RecipeHandler h )
public String getPattern( final RecipeHandler h )
{
StringBuilder o = new StringBuilder( "shapeless " + this.output.getQty() + '\n' );
final StringBuilder o = new StringBuilder( "shapeless " + this.output.getQty() + '\n' );
o.append( h.getName( this.output ) ).append( '\n' );
for( int y = 0; y < this.inputs.size(); y++ )
{
IIngredient i = this.inputs.get( y );
final IIngredient i = this.inputs.get( y );
if( i.isAir() )
{
@@ -118,14 +118,14 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer
}
@Override
public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError
{
for( IIngredient i : this.inputs )
for( final IIngredient i : this.inputs )
{
if( !i.isAir() )
{
for( ItemStack r : i.getItemStackSet() )
for( final ItemStack r : i.getItemStackSet() )
{
if( Platform.isSameItemPrecise( r, reqOutput ) )
{
@@ -39,12 +39,12 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer
IIngredient out;
@Override
public void setup( List<List<IIngredient>> input, List<List<IIngredient>> output ) throws RecipeError
public void setup( final List<List<IIngredient>> input, final List<List<IIngredient>> output ) throws RecipeError
{
if( input.size() == 1 && output.size() == 1 )
{
List<IIngredient> inputList = input.get( 0 );
List<IIngredient> outputList = output.get( 0 );
final List<IIngredient> inputList = input.get( 0 );
final List<IIngredient> outputList = output.get( 0 );
if( inputList.size() == 1 && outputList.size() == 1 )
{
this.in = inputList.get( 0 );
@@ -72,7 +72,7 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer
}
@Override
public String getPattern( RecipeHandler h )
public String getPattern( final RecipeHandler h )
{
return "smelt " + this.out.getQty() + '\n' +
h.getName( this.out ) + '\n' +
@@ -80,7 +80,7 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer
}
@Override
public boolean canCraft( ItemStack reqOutput ) throws RegistrationError, MissingIngredientError
public boolean canCraft( final ItemStack reqOutput ) throws RegistrationError, MissingIngredientError
{
return Platform.isSameItemPrecise( this.out.getItemStack(), reqOutput );
}
@@ -36,14 +36,14 @@ public final class ConfigLoader implements IRecipeLoader
private final File generatedRecipesDir;
private final File userRecipesDir;
public ConfigLoader( File generatedRecipesDir, File userRecipesDir )
public ConfigLoader( final File generatedRecipesDir, final File userRecipesDir )
{
this.generatedRecipesDir = generatedRecipesDir;
this.userRecipesDir = userRecipesDir;
}
@Override
public BufferedReader getFile( @Nonnull String relativeFilePath ) throws Exception
public BufferedReader getFile( @Nonnull final String relativeFilePath ) throws Exception
{
Preconditions.checkNotNull( relativeFilePath );
Preconditions.checkArgument( !relativeFilePath.isEmpty(), "Supplying an empty String will result creating a reader of a folder." );
@@ -34,13 +34,13 @@ public class JarLoader implements IRecipeLoader
private final String rootPath;
public JarLoader( String s )
public JarLoader( final String s )
{
this.rootPath = s;
}
@Override
public BufferedReader getFile( @Nonnull String s ) throws Exception
public BufferedReader getFile( @Nonnull final String s ) throws Exception
{
Preconditions.checkNotNull( s );
Preconditions.checkArgument( !s.isEmpty() );
@@ -66,7 +66,7 @@ public class RecipeResourceCopier
*
* @throws NullPointerException if root is <tt>null</tt>
*/
public RecipeResourceCopier( @Nonnull String root )
public RecipeResourceCopier( @Nonnull final String root )
{
Preconditions.checkNotNull( root );
@@ -83,7 +83,7 @@ public class RecipeResourceCopier
* @throws NullPointerException if either parameter is <tt>null</tt>
* @throws IllegalArgumentException if destination is not a directory
*/
public void copyTo( @Nonnull File destination ) throws URISyntaxException, IOException
public void copyTo( @Nonnull final File destination ) throws URISyntaxException, IOException
{
Preconditions.checkNotNull( destination );
Preconditions.checkArgument( destination.isDirectory() );
@@ -100,13 +100,13 @@ public class RecipeResourceCopier
* @throws URISyntaxException {@see #getResourceListing}
* @throws IOException {@see #getResourceListing} and if copying the detected resource to file is not possible
*/
private void copyTo( File destination, String directory ) throws URISyntaxException, IOException
private void copyTo( final File destination, final String directory ) throws URISyntaxException, IOException
{
assert destination != null;
assert directory != null;
final String[] listing = this.getResourceListing( this.getClass(), directory );
for( String list : listing )
for( final String list : listing )
{
if( list.endsWith( ".recipe" ) || list.endsWith( ".html" ) )
{
@@ -130,7 +130,7 @@ public class RecipeResourceCopier
*
* @throws IOException if copying the file is not possible
*/
private void copyFile( File destination, String directory, String fileName ) throws IOException
private void copyFile( final File destination, final String directory, final String fileName ) throws IOException
{
assert destination != null;
assert fileName != null;
@@ -160,7 +160,7 @@ public class RecipeResourceCopier
* @throws UnsupportedOperationException if it is neither in jar nor in file path
*/
@Nonnull
private String[] getResourceListing( Class<?> clazz, String path ) throws URISyntaxException, IOException
private String[] getResourceListing( final Class<?> clazz, final String path ) throws URISyntaxException, IOException
{
assert clazz != null;
assert path != null;
@@ -40,7 +40,7 @@ public class OreDictionaryHandler
private boolean enableRebaking = false;
@SubscribeEvent
public void onOreDictionaryRegister( OreDictionary.OreRegisterEvent event )
public void onOreDictionaryRegister( final OreDictionary.OreRegisterEvent event )
{
if( event.Name == null || event.Ore == null )
{
@@ -49,7 +49,7 @@ public class OreDictionaryHandler
if( this.shouldCare( event.Name ) )
{
for( IOreListener v : this.oreListeners )
for( final IOreListener v : this.oreListeners )
{
v.oreRegistered( event.Name, event.Ore );
}
@@ -68,7 +68,7 @@ public class OreDictionaryHandler
*
* @return true if it should care
*/
private boolean shouldCare( String name )
private boolean shouldCare( final String name )
{
return true;
}
@@ -77,7 +77,7 @@ public class OreDictionaryHandler
{
this.enableRebaking = true;
for( Object o : CraftingManager.getInstance().getRecipeList() )
for( final Object o : CraftingManager.getInstance().getRecipeList() )
{
if( o instanceof IRecipeBakeable )
{
@@ -85,7 +85,7 @@ public class OreDictionaryHandler
{
( (IRecipeBakeable) o ).bake();
}
catch( Throwable e )
catch( final Throwable e )
{
AELog.error( e );
}
@@ -99,16 +99,16 @@ public class OreDictionaryHandler
*
* @param n to be added ore listener
*/
public void observe( IOreListener n )
public void observe( final IOreListener n )
{
this.oreListeners.add( n );
// notify the listener of any ore already in existence.
for( String name : OreDictionary.getOreNames() )
for( final String name : OreDictionary.getOreNames() )
{
if( name != null && this.shouldCare( name ) )
{
for( ItemStack item : OreDictionary.getOres( name ) )
for( final ItemStack item : OreDictionary.getOres( name ) )
{
if( item != null )
{