Changed access to use this qualifier
This commit is contained in:
@@ -45,12 +45,12 @@ public class AEItemResolver implements ISubItemResolver
|
||||
{
|
||||
if ( itemName.startsWith( "PaintBall." ) )
|
||||
{
|
||||
return paintBall( AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), false );
|
||||
return this.paintBall( AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), false );
|
||||
}
|
||||
|
||||
if ( itemName.startsWith( "LumenPaintBall." ) )
|
||||
{
|
||||
return paintBall( AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), true );
|
||||
return this.paintBall( AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), true );
|
||||
}
|
||||
|
||||
if ( itemName.equals( "CableGlass" ) )
|
||||
@@ -60,7 +60,7 @@ public class AEItemResolver implements ISubItemResolver
|
||||
|
||||
if ( itemName.startsWith( "CableGlass." ) )
|
||||
{
|
||||
return cableItem( AEApi.instance().parts().partCableGlass, itemName.substring( itemName.indexOf( "." ) + 1 ) );
|
||||
return this.cableItem( AEApi.instance().parts().partCableGlass, itemName.substring( itemName.indexOf( "." ) + 1 ) );
|
||||
}
|
||||
|
||||
if ( itemName.equals( "CableCovered" ) )
|
||||
@@ -70,7 +70,7 @@ public class AEItemResolver implements ISubItemResolver
|
||||
|
||||
if ( itemName.startsWith( "CableCovered." ) )
|
||||
{
|
||||
return cableItem( AEApi.instance().parts().partCableCovered, itemName.substring( itemName.indexOf( "." ) + 1 ) );
|
||||
return this.cableItem( AEApi.instance().parts().partCableCovered, itemName.substring( itemName.indexOf( "." ) + 1 ) );
|
||||
}
|
||||
|
||||
if ( itemName.equals( "CableSmart" ) )
|
||||
@@ -80,7 +80,7 @@ public class AEItemResolver implements ISubItemResolver
|
||||
|
||||
if ( itemName.startsWith( "CableSmart." ) )
|
||||
{
|
||||
return cableItem( AEApi.instance().parts().partCableSmart, itemName.substring( itemName.indexOf( "." ) + 1 ) );
|
||||
return this.cableItem( AEApi.instance().parts().partCableSmart, itemName.substring( itemName.indexOf( "." ) + 1 ) );
|
||||
}
|
||||
|
||||
if ( itemName.equals( "CableDense" ) )
|
||||
@@ -90,7 +90,7 @@ public class AEItemResolver implements ISubItemResolver
|
||||
|
||||
if ( itemName.startsWith( "CableDense." ) )
|
||||
{
|
||||
return cableItem( AEApi.instance().parts().partCableDense, itemName.substring( itemName.indexOf( "." ) + 1 ) );
|
||||
return this.cableItem( AEApi.instance().parts().partCableDense, itemName.substring( itemName.indexOf( "." ) + 1 ) );
|
||||
}
|
||||
|
||||
if ( itemName.startsWith( "ItemCrystalSeed." ) )
|
||||
|
||||
@@ -40,7 +40,7 @@ public class GroupIngredient implements IIngredient
|
||||
boolean isInside = false;
|
||||
|
||||
public GroupIngredient(String myName, List<IIngredient> ingredients) throws RecipeError {
|
||||
name = myName;
|
||||
this.name = myName;
|
||||
|
||||
for (IIngredient I : ingredients)
|
||||
if ( I.isAir() )
|
||||
@@ -51,7 +51,7 @@ public class GroupIngredient implements IIngredient
|
||||
|
||||
public IIngredient copy(int qty) throws RecipeError
|
||||
{
|
||||
GroupIngredient gi = new GroupIngredient( name, ingredients );
|
||||
GroupIngredient gi = new GroupIngredient( this.name, this.ingredients );
|
||||
gi.qty = qty;
|
||||
return gi;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class GroupIngredient implements IIngredient
|
||||
@Override
|
||||
public String getItemName()
|
||||
{
|
||||
return name;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,17 +77,17 @@ public class GroupIngredient implements IIngredient
|
||||
@Override
|
||||
public ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
if ( baked != null )
|
||||
return baked;
|
||||
if ( this.baked != null )
|
||||
return this.baked;
|
||||
|
||||
if ( isInside )
|
||||
if ( this.isInside )
|
||||
return new ItemStack[0];
|
||||
|
||||
List<ItemStack> out = new LinkedList<ItemStack>();
|
||||
isInside = true;
|
||||
this.isInside = true;
|
||||
try
|
||||
{
|
||||
for (IIngredient i : ingredients)
|
||||
for (IIngredient i : this.ingredients)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -101,14 +101,14 @@ public class GroupIngredient implements IIngredient
|
||||
}
|
||||
finally
|
||||
{
|
||||
isInside = false;
|
||||
this.isInside = false;
|
||||
}
|
||||
|
||||
if ( out.size() == 0 )
|
||||
throw new MissingIngredientError( toString() + " - group could not be resolved to any items." );
|
||||
throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." );
|
||||
|
||||
for (ItemStack is : out)
|
||||
is.stackSize = qty;
|
||||
is.stackSize = this.qty;
|
||||
|
||||
return out.toArray( new ItemStack[out.size()] );
|
||||
}
|
||||
@@ -134,8 +134,8 @@ public class GroupIngredient implements IIngredient
|
||||
@Override
|
||||
public void bake() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
baked = null;
|
||||
baked = getItemStackSet();
|
||||
this.baked = null;
|
||||
this.baked = this.getItemStackSet();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,25 +58,25 @@ public class Ingredient implements IIngredient
|
||||
|
||||
if ( input.equals( "_" ) )
|
||||
{
|
||||
isAir = true;
|
||||
nameSpace = "";
|
||||
itemName = "";
|
||||
meta = OreDictionary.WILDCARD_VALUE;
|
||||
this.isAir = true;
|
||||
this.nameSpace = "";
|
||||
this.itemName = "";
|
||||
this.meta = OreDictionary.WILDCARD_VALUE;
|
||||
return;
|
||||
}
|
||||
|
||||
isAir = false;
|
||||
this.isAir = false;
|
||||
String[] parts = input.split( ":" );
|
||||
if ( parts.length >= 2 )
|
||||
{
|
||||
nameSpace = handler.alias( parts[0] );
|
||||
this.nameSpace = handler.alias( parts[0] );
|
||||
String tmpName = handler.alias( parts[1] );
|
||||
|
||||
if ( parts.length != 3 )
|
||||
{
|
||||
int sel = 0;
|
||||
|
||||
if ( nameSpace.equals( "oreDictionary" ) )
|
||||
if ( this.nameSpace.equals( "oreDictionary" ) )
|
||||
{
|
||||
if ( parts.length == 3 )
|
||||
throw new RecipeError( "Cannot specify meta when using ore dictionary." );
|
||||
@@ -86,13 +86,13 @@ public class Ingredient implements IIngredient
|
||||
{
|
||||
try
|
||||
{
|
||||
Object ro = AEApi.instance().registries().recipes().resolveItem( nameSpace, tmpName );
|
||||
Object ro = AEApi.instance().registries().recipes().resolveItem( this.nameSpace, tmpName );
|
||||
if ( ro instanceof ResolverResult )
|
||||
{
|
||||
ResolverResult rr = (ResolverResult) ro;
|
||||
tmpName = rr.itemName;
|
||||
sel = rr.damageValue;
|
||||
nbt = rr.compound;
|
||||
this.nbt = rr.compound;
|
||||
}
|
||||
else if ( ro instanceof ResolverResultSet )
|
||||
{
|
||||
@@ -105,19 +105,19 @@ public class Ingredient implements IIngredient
|
||||
}
|
||||
}
|
||||
|
||||
meta = sel;
|
||||
this.meta = sel;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( parts[2].equals( "*" ) )
|
||||
{
|
||||
meta = OreDictionary.WILDCARD_VALUE;
|
||||
this.meta = OreDictionary.WILDCARD_VALUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
meta = Integer.parseInt( parts[2] );
|
||||
this.meta = Integer.parseInt( parts[2] );
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
@@ -125,40 +125,40 @@ public class Ingredient implements IIngredient
|
||||
}
|
||||
}
|
||||
}
|
||||
itemName = tmpName;
|
||||
this.itemName = tmpName;
|
||||
}
|
||||
else
|
||||
throw new RecipeError( input + " : Needs at least Namespace and Name." );
|
||||
|
||||
handler.data.knownItem.add( toString() );
|
||||
handler.data.knownItem.add( this.toString() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
if ( isAir )
|
||||
if ( this.isAir )
|
||||
throw new RegistrationError( "Found blank item and expected a real item." );
|
||||
|
||||
if ( nameSpace.equalsIgnoreCase( "oreDictionary" ) )
|
||||
if ( this.nameSpace.equalsIgnoreCase( "oreDictionary" ) )
|
||||
throw new RegistrationError( "Recipe format expected a single item, but got a set of items." );
|
||||
|
||||
Block blk = GameRegistry.findBlock( nameSpace, itemName );
|
||||
Block blk = GameRegistry.findBlock( this.nameSpace, this.itemName );
|
||||
if ( blk == null )
|
||||
blk = GameRegistry.findBlock( nameSpace, "tile." + itemName );
|
||||
blk = GameRegistry.findBlock( this.nameSpace, "tile." + this.itemName );
|
||||
|
||||
if ( blk != null )
|
||||
{
|
||||
Item it = Item.getItemFromBlock( blk );
|
||||
if ( it != null )
|
||||
return MakeItemStack( it, qty, meta, nbt );
|
||||
return this.MakeItemStack( it, this.qty, this.meta, this.nbt );
|
||||
}
|
||||
|
||||
Item it = GameRegistry.findItem( nameSpace, itemName );
|
||||
Item it = GameRegistry.findItem( this.nameSpace, this.itemName );
|
||||
if ( it == null )
|
||||
it = GameRegistry.findItem( nameSpace, "item." + itemName );
|
||||
it = GameRegistry.findItem( this.nameSpace, "item." + this.itemName );
|
||||
|
||||
if ( it != null )
|
||||
return MakeItemStack( it, qty, meta, nbt );
|
||||
return this.MakeItemStack( it, this.qty, this.meta, this.nbt );
|
||||
|
||||
/*
|
||||
* Object o = Item.itemRegistry.getObject( nameSpace + ":" + itemName ); if ( o instanceof Item ) return new
|
||||
@@ -173,7 +173,7 @@ public class Ingredient implements IIngredient
|
||||
* instanceof BlockAir)) ) return new ItemStack( (Block) o, qty, meta );
|
||||
*/
|
||||
|
||||
throw new MissingIngredientError( "Unable to find item: " + toString() );
|
||||
throw new MissingIngredientError( "Unable to find item: " + this.toString() );
|
||||
}
|
||||
|
||||
private ItemStack MakeItemStack(Item it, int quantity, int damageValue, NBTTagCompound compound)
|
||||
@@ -186,72 +186,72 @@ public class Ingredient implements IIngredient
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return nameSpace + ':' + itemName + ':' + meta;
|
||||
return this.nameSpace + ':' + this.itemName + ':' + this.meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
if ( baked != null )
|
||||
return baked;
|
||||
if ( this.baked != null )
|
||||
return this.baked;
|
||||
|
||||
if ( nameSpace.equalsIgnoreCase( "oreDictionary" ) )
|
||||
if ( this.nameSpace.equalsIgnoreCase( "oreDictionary" ) )
|
||||
{
|
||||
List<ItemStack> ores = OreDictionary.getOres( itemName );
|
||||
List<ItemStack> ores = OreDictionary.getOres( this.itemName );
|
||||
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();
|
||||
is.stackSize = qty;
|
||||
is.stackSize = this.qty;
|
||||
set[x] = is;
|
||||
}
|
||||
|
||||
if ( set.length == 0 )
|
||||
throw new MissingIngredientError( getItemName() + " - ore dictionary could not be resolved to any items." );
|
||||
throw new MissingIngredientError( this.getItemName() + " - ore dictionary could not be resolved to any items." );
|
||||
|
||||
return set;
|
||||
}
|
||||
|
||||
return new ItemStack[] { getItemStack() };
|
||||
return new ItemStack[] { this.getItemStack() };
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNameSpace()
|
||||
{
|
||||
return nameSpace;
|
||||
return this.nameSpace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName()
|
||||
{
|
||||
return itemName;
|
||||
return this.itemName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue()
|
||||
{
|
||||
return meta;
|
||||
return this.meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getQty()
|
||||
{
|
||||
return qty;
|
||||
return this.qty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAir()
|
||||
{
|
||||
return isAir;
|
||||
return this.isAir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bake() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
baked = null;
|
||||
baked = getItemStackSet();
|
||||
this.baked = null;
|
||||
this.baked = this.getItemStackSet();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ public class IngredientSet implements IIngredient
|
||||
ItemStack[] baked;
|
||||
|
||||
public IngredientSet(ResolverResultSet rr) {
|
||||
name = rr.name;
|
||||
items = rr.results;
|
||||
this.name = rr.name;
|
||||
this.items = rr.results;
|
||||
}
|
||||
|
||||
final boolean isInside = false;
|
||||
@@ -52,7 +52,7 @@ public class IngredientSet implements IIngredient
|
||||
@Override
|
||||
public String getItemName()
|
||||
{
|
||||
return name;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,20 +64,20 @@ public class IngredientSet implements IIngredient
|
||||
@Override
|
||||
public ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
if ( baked != null )
|
||||
return baked;
|
||||
if ( this.baked != null )
|
||||
return this.baked;
|
||||
|
||||
if ( isInside )
|
||||
if ( this.isInside )
|
||||
return new ItemStack[0];
|
||||
|
||||
List<ItemStack> out = new LinkedList<ItemStack>();
|
||||
out.addAll( items );
|
||||
out.addAll( this.items );
|
||||
|
||||
if ( out.size() == 0 )
|
||||
throw new MissingIngredientError( toString() + " - group could not be resolved to any items." );
|
||||
throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." );
|
||||
|
||||
for (ItemStack is : out)
|
||||
is.stackSize = qty;
|
||||
is.stackSize = this.qty;
|
||||
|
||||
return out.toArray( new ItemStack[out.size()] );
|
||||
}
|
||||
@@ -103,8 +103,8 @@ public class IngredientSet implements IIngredient
|
||||
@Override
|
||||
public void bake() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
baked = null;
|
||||
baked = getItemStackSet();
|
||||
this.baked = null;
|
||||
this.baked = this.getItemStackSet();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class MissedIngredientSet extends Throwable
|
||||
final ResolverResultSet rrs;
|
||||
|
||||
public MissedIngredientSet(ResolverResultSet ro) {
|
||||
rrs = ro;
|
||||
this.rrs = ro;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -64,23 +64,23 @@ public class RecipeHandler implements IRecipeHandler
|
||||
final RecipeData data;
|
||||
|
||||
public RecipeHandler() {
|
||||
data = new RecipeData();
|
||||
this.data = new RecipeData();
|
||||
}
|
||||
|
||||
RecipeHandler(RecipeHandler parent) {
|
||||
data = parent.data;
|
||||
this.data = parent.data;
|
||||
}
|
||||
|
||||
private void addCrafting(ICraftHandler ch)
|
||||
{
|
||||
data.Handlers.add( ch );
|
||||
this.data.Handlers.add( ch );
|
||||
}
|
||||
|
||||
public List<IWebsiteSerializer> findRecipe(ItemStack output)
|
||||
{
|
||||
List<IWebsiteSerializer> out = new LinkedList<IWebsiteSerializer>();
|
||||
|
||||
for (ICraftHandler ch : data.Handlers)
|
||||
for (ICraftHandler ch : this.data.Handlers)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -107,7 +107,7 @@ public class RecipeHandler implements IRecipeHandler
|
||||
HashMap<Class, Integer> processed = new HashMap<Class, Integer>();
|
||||
try
|
||||
{
|
||||
for (ICraftHandler ch : data.Handlers)
|
||||
for (ICraftHandler ch : this.data.Handlers)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -123,19 +123,19 @@ public class RecipeHandler implements IRecipeHandler
|
||||
catch (RegistrationError e)
|
||||
{
|
||||
AELog.warning( "Unable to register a recipe: " + e.getMessage() );
|
||||
if ( data.exceptions )
|
||||
if ( this.data.exceptions )
|
||||
AELog.error( e );
|
||||
if ( data.crash )
|
||||
if ( this.data.crash )
|
||||
throw e;
|
||||
}
|
||||
catch (MissingIngredientError e)
|
||||
{
|
||||
if ( data.errorOnMissing )
|
||||
if ( this.data.errorOnMissing )
|
||||
{
|
||||
AELog.warning( "Unable to register a recipe:" + e.getMessage() );
|
||||
if ( data.exceptions )
|
||||
if ( this.data.exceptions )
|
||||
AELog.error( e );
|
||||
if ( data.crash )
|
||||
if ( this.data.crash )
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -143,9 +143,9 @@ public class RecipeHandler implements IRecipeHandler
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
if ( data.exceptions )
|
||||
if ( this.data.exceptions )
|
||||
AELog.error( e );
|
||||
if ( data.crash )
|
||||
if ( this.data.crash )
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ public class RecipeHandler implements IRecipeHandler
|
||||
|
||||
HashMultimap<String, IWebsiteSerializer> combined = HashMultimap.create();
|
||||
|
||||
for (String s : data.knownItem)
|
||||
for (String s : this.data.knownItem)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -171,8 +171,8 @@ public class RecipeHandler implements IRecipeHandler
|
||||
|
||||
for (ItemStack is : i.getItemStackSet())
|
||||
{
|
||||
String realName = getName( is );
|
||||
List<IWebsiteSerializer> recipes = findRecipe( is );
|
||||
String realName = this.getName( is );
|
||||
List<IWebsiteSerializer> recipes = this.findRecipe( is );
|
||||
if ( !recipes.isEmpty() )
|
||||
combined.putAll( realName, recipes );
|
||||
}
|
||||
@@ -234,7 +234,7 @@ public class RecipeHandler implements IRecipeHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
return getName( is );
|
||||
return this.getName( is );
|
||||
}
|
||||
catch (RecipeError ignored)
|
||||
{
|
||||
@@ -339,7 +339,7 @@ public class RecipeHandler implements IRecipeHandler
|
||||
|
||||
public String alias(String in)
|
||||
{
|
||||
String out = data.aliases.get( in );
|
||||
String out = this.data.aliases.get( in );
|
||||
|
||||
if ( out != null )
|
||||
return out;
|
||||
@@ -360,7 +360,7 @@ public class RecipeHandler implements IRecipeHandler
|
||||
catch (Exception err)
|
||||
{
|
||||
AELog.warning( "Error Loading Recipe File:" + path );
|
||||
if ( data.exceptions )
|
||||
if ( this.data.exceptions )
|
||||
AELog.error( err );
|
||||
return;
|
||||
}
|
||||
@@ -406,18 +406,18 @@ public class RecipeHandler implements IRecipeHandler
|
||||
|
||||
if ( token.length() > 0 )
|
||||
{
|
||||
tokens.add( token );
|
||||
tokens.add( "," );
|
||||
this.tokens.add( token );
|
||||
this.tokens.add( "," );
|
||||
}
|
||||
token = "";
|
||||
break;
|
||||
|
||||
case '=':
|
||||
|
||||
processTokens( loader, path, line );
|
||||
this.processTokens( loader, path, line );
|
||||
|
||||
if ( token.length() > 0 )
|
||||
tokens.add( token );
|
||||
this.tokens.add( token );
|
||||
token = "";
|
||||
|
||||
break;
|
||||
@@ -432,7 +432,7 @@ public class RecipeHandler implements IRecipeHandler
|
||||
case ' ':
|
||||
|
||||
if ( token.length() > 0 )
|
||||
tokens.add( token );
|
||||
this.tokens.add( token );
|
||||
token = "";
|
||||
|
||||
break;
|
||||
@@ -444,15 +444,15 @@ public class RecipeHandler implements IRecipeHandler
|
||||
}
|
||||
|
||||
if ( token.length() > 0 )
|
||||
tokens.add( token );
|
||||
this.tokens.add( token );
|
||||
|
||||
reader.close();
|
||||
processTokens( loader, path, line );
|
||||
this.processTokens( loader, path, line );
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
AELog.error( e );
|
||||
if ( data.crash )
|
||||
if ( this.data.crash )
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
}
|
||||
@@ -463,64 +463,64 @@ public class RecipeHandler implements IRecipeHandler
|
||||
{
|
||||
IRecipeHandlerRegistry cr = AEApi.instance().registries().recipes();
|
||||
|
||||
if ( tokens.isEmpty() )
|
||||
if ( this.tokens.isEmpty() )
|
||||
return;
|
||||
|
||||
int split = tokens.indexOf( "->" );
|
||||
int split = this.tokens.indexOf( "->" );
|
||||
if ( split != -1 )
|
||||
{
|
||||
String operation = tokens.remove( 0 ).toLowerCase();
|
||||
String operation = this.tokens.remove( 0 ).toLowerCase();
|
||||
|
||||
if ( operation.equals( "alias" ) )
|
||||
{
|
||||
if ( tokens.size() == 3 && tokens.indexOf( "->" ) == 1 )
|
||||
data.aliases.put( tokens.get( 0 ), tokens.get( 2 ) );
|
||||
if ( this.tokens.size() == 3 && this.tokens.indexOf( "->" ) == 1 )
|
||||
this.data.aliases.put( this.tokens.get( 0 ), this.tokens.get( 2 ) );
|
||||
else
|
||||
throw new RecipeError( "Alias must have exactly 1 input and 1 output." );
|
||||
}
|
||||
else if ( operation.equals( "group" ) )
|
||||
{
|
||||
List<String> pre = tokens.subList( 0, split - 1 );
|
||||
List<String> post = tokens.subList( split, tokens.size() );
|
||||
List<String> pre = this.tokens.subList( 0, split - 1 );
|
||||
List<String> post = this.tokens.subList( split, this.tokens.size() );
|
||||
|
||||
List<List<IIngredient>> inputs = parseLines( pre );
|
||||
List<List<IIngredient>> inputs = this.parseLines( pre );
|
||||
|
||||
if ( inputs.size() == 1 && inputs.get( 0 ).size() > 0 && post.size() == 1 )
|
||||
{
|
||||
data.groups.put( post.get( 0 ), new GroupIngredient( post.get( 0 ), inputs.get( 0 ) ) );
|
||||
this.data.groups.put( post.get( 0 ), new GroupIngredient( post.get( 0 ), inputs.get( 0 ) ) );
|
||||
}
|
||||
else
|
||||
throw new RecipeError( "Group must have exactly 1 output, and 1 or more inputs." );
|
||||
}
|
||||
else if ( operation.equals( "ore" ) )
|
||||
{
|
||||
List<String> pre = tokens.subList( 0, split - 1 );
|
||||
List<String> post = tokens.subList( split, tokens.size() );
|
||||
List<String> pre = this.tokens.subList( 0, split - 1 );
|
||||
List<String> post = this.tokens.subList( split, this.tokens.size() );
|
||||
|
||||
List<List<IIngredient>> inputs = parseLines( pre );
|
||||
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 ) );
|
||||
addCrafting( ch );
|
||||
this.addCrafting( ch );
|
||||
}
|
||||
else
|
||||
throw new RecipeError( "Group must have exactly 1 output, and 1 or more inputs in a single row." );
|
||||
}
|
||||
else
|
||||
{
|
||||
List<String> pre = tokens.subList( 0, split - 1 );
|
||||
List<String> post = tokens.subList( split, tokens.size() );
|
||||
List<String> pre = this.tokens.subList( 0, split - 1 );
|
||||
List<String> post = this.tokens.subList( split, this.tokens.size() );
|
||||
|
||||
List<List<IIngredient>> inputs = parseLines( pre );
|
||||
List<List<IIngredient>> outputs = parseLines( post );
|
||||
List<List<IIngredient>> inputs = this.parseLines( pre );
|
||||
List<List<IIngredient>> outputs = this.parseLines( post );
|
||||
|
||||
ICraftHandler ch = cr.getCraftHandlerFor( operation );
|
||||
|
||||
if ( ch != null )
|
||||
{
|
||||
ch.setup( inputs, outputs );
|
||||
addCrafting( ch );
|
||||
this.addCrafting( ch );
|
||||
}
|
||||
else
|
||||
throw new RecipeError( "Invalid crafting type: " + operation );
|
||||
@@ -528,57 +528,57 @@ public class RecipeHandler implements IRecipeHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
String operation = tokens.remove( 0 ).toLowerCase();
|
||||
String operation = this.tokens.remove( 0 ).toLowerCase();
|
||||
|
||||
if ( operation.equals( "exceptions" ) && (tokens.get( 0 ).equals( "true" ) || tokens.get( 0 ).equals( "false" )) )
|
||||
if ( operation.equals( "exceptions" ) && (this.tokens.get( 0 ).equals( "true" ) || this.tokens.get( 0 ).equals( "false" )) )
|
||||
{
|
||||
if ( tokens.size() == 1 )
|
||||
if ( this.tokens.size() == 1 )
|
||||
{
|
||||
data.exceptions = tokens.get( 0 ).equals( "true" );
|
||||
this.data.exceptions = this.tokens.get( 0 ).equals( "true" );
|
||||
}
|
||||
else
|
||||
throw new RecipeError( "exceptions must be true or false explicitly." );
|
||||
}
|
||||
else if ( operation.equals( "crash" ) && (tokens.get( 0 ).equals( "true" ) || tokens.get( 0 ).equals( "false" )) )
|
||||
else if ( operation.equals( "crash" ) && (this.tokens.get( 0 ).equals( "true" ) || this.tokens.get( 0 ).equals( "false" )) )
|
||||
{
|
||||
if ( tokens.size() == 1 )
|
||||
if ( this.tokens.size() == 1 )
|
||||
{
|
||||
data.crash = tokens.get( 0 ).equals( "true" );
|
||||
this.data.crash = this.tokens.get( 0 ).equals( "true" );
|
||||
}
|
||||
else
|
||||
throw new RecipeError( "crash must be true or false explicitly." );
|
||||
}
|
||||
else if ( operation.equals( "erroronmissing" ) )
|
||||
{
|
||||
if ( tokens.size() == 1 && (tokens.get( 0 ).equals( "true" ) || tokens.get( 0 ).equals( "false" )) )
|
||||
if ( this.tokens.size() == 1 && (this.tokens.get( 0 ).equals( "true" ) || this.tokens.get( 0 ).equals( "false" )) )
|
||||
{
|
||||
data.errorOnMissing = tokens.get( 0 ).equals( "true" );
|
||||
this.data.errorOnMissing = this.tokens.get( 0 ).equals( "true" );
|
||||
}
|
||||
else
|
||||
throw new RecipeError( "erroronmissing must be true or false explicitly." );
|
||||
}
|
||||
else if ( operation.equals( "import" ) )
|
||||
{
|
||||
if ( tokens.size() == 1 )
|
||||
(new RecipeHandler( this )).parseRecipes( loader, tokens.get( 0 ) );
|
||||
if ( this.tokens.size() == 1 )
|
||||
(new RecipeHandler( this )).parseRecipes( loader, this.tokens.get( 0 ) );
|
||||
else
|
||||
throw new RecipeError( "Import must have exactly 1 input." );
|
||||
}
|
||||
else
|
||||
throw new RecipeError( operation + ": " + tokens.toString() + "; recipe without an output." );
|
||||
throw new RecipeError( operation + ": " + this.tokens.toString() + "; recipe without an output." );
|
||||
}
|
||||
|
||||
}
|
||||
catch (RecipeError e)
|
||||
{
|
||||
AELog.warning( "Recipe Error '" + e.getMessage() + "' near line:" + line + " in " + file + " with: " + tokens.toString() );
|
||||
if ( data.exceptions )
|
||||
AELog.warning( "Recipe Error '" + e.getMessage() + "' near line:" + line + " in " + file + " with: " + this.tokens.toString() );
|
||||
if ( this.data.exceptions )
|
||||
AELog.error( e );
|
||||
if ( data.crash )
|
||||
if ( this.data.crash )
|
||||
throw e;
|
||||
}
|
||||
|
||||
tokens.clear();
|
||||
this.tokens.clear();
|
||||
}
|
||||
|
||||
private List<List<IIngredient>> parseLines(List<String> subList) throws RecipeError
|
||||
@@ -601,7 +601,7 @@ public class RecipeHandler implements IRecipeHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isNumber( v ) )
|
||||
if ( this.isNumber( v ) )
|
||||
{
|
||||
if ( hasQty )
|
||||
throw new RecipeError( "Qty found with no item." );
|
||||
@@ -612,11 +612,11 @@ public class RecipeHandler implements IRecipeHandler
|
||||
{
|
||||
if ( hasQty )
|
||||
{
|
||||
cList.add( findIngredient( v, qty ) );
|
||||
cList.add( this.findIngredient( v, qty ) );
|
||||
hasQty = false;
|
||||
}
|
||||
else
|
||||
cList.add( findIngredient( v, 1 ) );
|
||||
cList.add( this.findIngredient( v, 1 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -629,7 +629,7 @@ public class RecipeHandler implements IRecipeHandler
|
||||
|
||||
private IIngredient findIngredient(String v, int qty) throws RecipeError
|
||||
{
|
||||
GroupIngredient gi = data.groups.get( v );
|
||||
GroupIngredient gi = this.data.groups.get( v );
|
||||
|
||||
if ( gi != null )
|
||||
return gi.copy( qty );
|
||||
|
||||
@@ -50,17 +50,17 @@ public class DisassembleRecipe implements IRecipe
|
||||
if ( hasCell != null )
|
||||
return null;
|
||||
|
||||
if ( items.itemCell1k.sameAsStack( is ) )
|
||||
hasCell = mats.materialCell1kPart.stack( 1 );
|
||||
if ( this.items.itemCell1k.sameAsStack( is ) )
|
||||
hasCell = this.mats.materialCell1kPart.stack( 1 );
|
||||
|
||||
if ( items.itemCell4k.sameAsStack( is ) )
|
||||
hasCell = mats.materialCell4kPart.stack( 1 );
|
||||
if ( this.items.itemCell4k.sameAsStack( is ) )
|
||||
hasCell = this.mats.materialCell4kPart.stack( 1 );
|
||||
|
||||
if ( items.itemCell16k.sameAsStack( is ) )
|
||||
hasCell = mats.materialCell16kPart.stack( 1 );
|
||||
if ( this.items.itemCell16k.sameAsStack( is ) )
|
||||
hasCell = this.mats.materialCell16kPart.stack( 1 );
|
||||
|
||||
if ( items.itemCell64k.sameAsStack( is ) )
|
||||
hasCell = mats.materialCell64kPart.stack( 1 );
|
||||
if ( this.items.itemCell64k.sameAsStack( is ) )
|
||||
hasCell = this.mats.materialCell64kPart.stack( 1 );
|
||||
|
||||
// make sure the storage cell is empty...
|
||||
if ( hasCell != null )
|
||||
@@ -74,20 +74,20 @@ public class DisassembleRecipe implements IRecipe
|
||||
}
|
||||
}
|
||||
|
||||
if ( items.itemEncodedPattern.sameAsStack( is ) )
|
||||
hasCell = mats.materialBlankPattern.stack( 1 );
|
||||
if ( this.items.itemEncodedPattern.sameAsStack( is ) )
|
||||
hasCell = this.mats.materialBlankPattern.stack( 1 );
|
||||
|
||||
if ( blocks.blockCraftingStorage1k.sameAsStack( is ) )
|
||||
hasCell = mats.materialCell1kPart.stack( 1 );
|
||||
if ( this.blocks.blockCraftingStorage1k.sameAsStack( is ) )
|
||||
hasCell = this.mats.materialCell1kPart.stack( 1 );
|
||||
|
||||
if ( blocks.blockCraftingStorage4k.sameAsStack( is ) )
|
||||
hasCell = mats.materialCell4kPart.stack( 1 );
|
||||
if ( this.blocks.blockCraftingStorage4k.sameAsStack( is ) )
|
||||
hasCell = this.mats.materialCell4kPart.stack( 1 );
|
||||
|
||||
if ( blocks.blockCraftingStorage16k.sameAsStack( is ) )
|
||||
hasCell = mats.materialCell16kPart.stack( 1 );
|
||||
if ( this.blocks.blockCraftingStorage16k.sameAsStack( is ) )
|
||||
hasCell = this.mats.materialCell16kPart.stack( 1 );
|
||||
|
||||
if ( blocks.blockCraftingStorage64k.sameAsStack( is ) )
|
||||
hasCell = mats.materialCell64kPart.stack( 1 );
|
||||
if ( this.blocks.blockCraftingStorage64k.sameAsStack( is ) )
|
||||
hasCell = this.mats.materialCell64kPart.stack( 1 );
|
||||
|
||||
if ( hasCell == null )
|
||||
return null;
|
||||
@@ -100,13 +100,13 @@ public class DisassembleRecipe implements IRecipe
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World w)
|
||||
{
|
||||
return getOutput( inv, false ) != null;
|
||||
return this.getOutput( inv, false ) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv)
|
||||
{
|
||||
return getOutput( inv, true );
|
||||
return this.getOutput( inv, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,10 +36,10 @@ public class FacadeRecipe implements IRecipe
|
||||
{
|
||||
if ( inv.getStackInSlot( 0 ) == null && inv.getStackInSlot( 2 ) == null && inv.getStackInSlot( 6 ) == null && inv.getStackInSlot( 8 ) == null )
|
||||
{
|
||||
if ( anchor.sameAsStack( inv.getStackInSlot( 1 ) ) && anchor.sameAsStack( inv.getStackInSlot( 3 ) ) && anchor.sameAsStack( inv.getStackInSlot( 5 ) )
|
||||
&& anchor.sameAsStack( inv.getStackInSlot( 7 ) ) )
|
||||
if ( this.anchor.sameAsStack( inv.getStackInSlot( 1 ) ) && this.anchor.sameAsStack( inv.getStackInSlot( 3 ) ) && this.anchor.sameAsStack( inv.getStackInSlot( 5 ) )
|
||||
&& this.anchor.sameAsStack( inv.getStackInSlot( 7 ) ) )
|
||||
{
|
||||
ItemStack facades = facade.createFacadeForItem( inv.getStackInSlot( 4 ), !createFacade );
|
||||
ItemStack facades = this.facade.createFacadeForItem( inv.getStackInSlot( 4 ), !createFacade );
|
||||
if ( facades != null && createFacade )
|
||||
facades.stackSize = 4;
|
||||
return facades;
|
||||
@@ -51,13 +51,13 @@ public class FacadeRecipe implements IRecipe
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World w)
|
||||
{
|
||||
return getOutput( inv, false ) != null;
|
||||
return this.getOutput( inv, false ) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv)
|
||||
{
|
||||
return getOutput( inv, true );
|
||||
return this.getOutput( inv, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,19 +46,19 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return !disable;
|
||||
return !this.disable;
|
||||
}
|
||||
|
||||
public ShapedRecipe(ItemStack result, Object... recipe)
|
||||
{
|
||||
output = result.copy();
|
||||
this.output = result.copy();
|
||||
|
||||
StringBuilder shape = new StringBuilder();
|
||||
int idx = 0;
|
||||
|
||||
if ( recipe[idx] instanceof Boolean )
|
||||
{
|
||||
mirrored = (Boolean) recipe[idx];
|
||||
this.mirrored = (Boolean) recipe[idx];
|
||||
if ( recipe[idx + 1] instanceof Object[] )
|
||||
{
|
||||
recipe = (Object[]) recipe[idx + 1];
|
||||
@@ -75,11 +75,11 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
|
||||
for (String s : parts)
|
||||
{
|
||||
width = s.length();
|
||||
this.width = s.length();
|
||||
shape.append( s );
|
||||
}
|
||||
|
||||
height = parts.length;
|
||||
this.height = parts.length;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -87,19 +87,19 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
{
|
||||
String s = (String) recipe[idx++];
|
||||
shape.append( s );
|
||||
width = s.length();
|
||||
height++;
|
||||
this.width = s.length();
|
||||
this.height++;
|
||||
}
|
||||
}
|
||||
|
||||
if ( width * height != shape.length() )
|
||||
if ( this.width * this.height != shape.length() )
|
||||
{
|
||||
StringBuilder ret = new StringBuilder( "Invalid shaped ore recipe: " );
|
||||
for (Object tmp : recipe)
|
||||
{
|
||||
ret.append( tmp ).append( ", " );
|
||||
}
|
||||
ret.append( output );
|
||||
ret.append( this.output );
|
||||
throw new RuntimeException( ret.toString() );
|
||||
}
|
||||
|
||||
@@ -121,53 +121,53 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
{
|
||||
ret.append( tmp ).append( ", " );
|
||||
}
|
||||
ret.append( output );
|
||||
ret.append( this.output );
|
||||
throw new RuntimeException( ret.toString() );
|
||||
}
|
||||
}
|
||||
|
||||
input = new Object[width * height];
|
||||
this.input = new Object[this.width * this.height];
|
||||
int x = 0;
|
||||
for (char chr : shape.toString().toCharArray())
|
||||
{
|
||||
input[x++] = itemMap.get( chr );
|
||||
this.input[x++] = itemMap.get( chr );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting var1)
|
||||
{
|
||||
return output.copy();
|
||||
return this.output.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize()
|
||||
{
|
||||
return input.length;
|
||||
return this.input.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput()
|
||||
{
|
||||
return output;
|
||||
return this.output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world)
|
||||
{
|
||||
if ( disable )
|
||||
if ( this.disable )
|
||||
return false;
|
||||
|
||||
for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
|
||||
for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - this.width; x++)
|
||||
{
|
||||
for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
|
||||
for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - this.height; ++y)
|
||||
{
|
||||
if ( checkMatch( inv, x, y, false ) )
|
||||
if ( this.checkMatch( inv, x, y, false ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( mirrored && checkMatch( inv, x, y, true ) )
|
||||
if ( this.mirrored && this.checkMatch( inv, x, y, true ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
@SuppressWarnings("unchecked")
|
||||
private boolean checkMatch(InventoryCrafting inv, int startX, int startY, boolean mirror)
|
||||
{
|
||||
if ( disable )
|
||||
if ( this.disable )
|
||||
return false;
|
||||
|
||||
for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++)
|
||||
@@ -191,15 +191,15 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
int subY = y - startY;
|
||||
Object target = null;
|
||||
|
||||
if ( subX >= 0 && subY >= 0 && subX < width && subY < height )
|
||||
if ( subX >= 0 && subY >= 0 && subX < this.width && subY < this.height )
|
||||
{
|
||||
if ( mirror )
|
||||
{
|
||||
target = input[width - subX - 1 + subY * width];
|
||||
target = this.input[this.width - subX - 1 + subY * this.width];
|
||||
}
|
||||
else
|
||||
{
|
||||
target = input[subX + subY * width];
|
||||
target = this.input[subX + subY * this.width];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
{
|
||||
for (ItemStack item : ((IIngredient) target).getItemStackSet())
|
||||
{
|
||||
matched = matched || checkItemEquals( item, slot );
|
||||
matched = matched || this.checkItemEquals( item, slot );
|
||||
}
|
||||
}
|
||||
catch (RegistrationError e)
|
||||
@@ -236,7 +236,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
|
||||
for (ItemStack item : (ArrayList<ItemStack>) target)
|
||||
{
|
||||
matched = matched || checkItemEquals( item, slot );
|
||||
matched = matched || this.checkItemEquals( item, slot );
|
||||
}
|
||||
|
||||
if ( !matched )
|
||||
@@ -266,7 +266,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
|
||||
public ShapedRecipe setMirrored(boolean mirror)
|
||||
{
|
||||
mirrored = mirror;
|
||||
this.mirrored = mirror;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -283,17 +283,17 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
|
||||
public int getWidth()
|
||||
{
|
||||
return width;
|
||||
return this.width;
|
||||
}
|
||||
|
||||
public int getHeight()
|
||||
{
|
||||
return height;
|
||||
return this.height;
|
||||
}
|
||||
|
||||
public Object[] getIngredients()
|
||||
{
|
||||
return input;
|
||||
return this.input;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -301,8 +301,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
{
|
||||
try
|
||||
{
|
||||
disable = false;
|
||||
for (Object o : getInput())
|
||||
this.disable = false;
|
||||
for (Object o : this.getInput())
|
||||
{
|
||||
if ( o instanceof IIngredient )
|
||||
((IIngredient) o).bake();
|
||||
@@ -310,7 +310,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
}
|
||||
catch (MissingIngredientError err)
|
||||
{
|
||||
disable = true;
|
||||
this.disable = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,17 +38,17 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
|
||||
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return !disable;
|
||||
return !this.disable;
|
||||
}
|
||||
|
||||
public ShapelessRecipe(ItemStack result, Object... recipe)
|
||||
{
|
||||
output = result.copy();
|
||||
this.output = result.copy();
|
||||
for (Object in : recipe)
|
||||
{
|
||||
if ( in instanceof IIngredient )
|
||||
{
|
||||
input.add( in );
|
||||
this.input.add( in );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -57,7 +57,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
|
||||
{
|
||||
ret.append( tmp ).append( ", " );
|
||||
}
|
||||
ret.append( output );
|
||||
ret.append( this.output );
|
||||
throw new RuntimeException( ret.toString() );
|
||||
}
|
||||
}
|
||||
@@ -66,29 +66,29 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
|
||||
@Override
|
||||
public int getRecipeSize()
|
||||
{
|
||||
return input.size();
|
||||
return this.input.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput()
|
||||
{
|
||||
return output;
|
||||
return this.output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting var1)
|
||||
{
|
||||
return output.copy();
|
||||
return this.output.copy();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting var1, World world)
|
||||
{
|
||||
if ( disable )
|
||||
if ( this.disable )
|
||||
return false;
|
||||
|
||||
ArrayList<Object> required = new ArrayList<Object>( input );
|
||||
ArrayList<Object> required = new ArrayList<Object>( this.input );
|
||||
|
||||
for (int x = 0; x < var1.getSizeInventory(); x++)
|
||||
{
|
||||
@@ -108,7 +108,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
|
||||
{
|
||||
for (ItemStack item : ((IIngredient) next).getItemStackSet())
|
||||
{
|
||||
match = match || checkItemEquals( item, slot );
|
||||
match = match || this.checkItemEquals( item, slot );
|
||||
}
|
||||
}
|
||||
catch (RegistrationError e)
|
||||
@@ -161,8 +161,8 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
|
||||
{
|
||||
try
|
||||
{
|
||||
disable = false;
|
||||
for (Object o : getInput())
|
||||
this.disable = false;
|
||||
for (Object o : this.getInput())
|
||||
{
|
||||
if ( o instanceof IIngredient )
|
||||
((IIngredient) o).bake();
|
||||
@@ -170,7 +170,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
|
||||
}
|
||||
catch (MissingIngredientError e)
|
||||
{
|
||||
disable = true;
|
||||
this.disable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,8 +47,8 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer
|
||||
int outs = output.get( 0 ).size();
|
||||
if ( input.get( 0 ).size() == 1 && outs == 1 )
|
||||
{
|
||||
pro_input = input.get( 0 ).get( 0 );
|
||||
pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
this.pro_input = input.get( 0 ).get( 0 );
|
||||
this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -61,11 +61,11 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer
|
||||
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.RC ) )
|
||||
{
|
||||
IRC rc = (IRC) AppEng.instance.getIntegration( IntegrationType.RC );
|
||||
for (ItemStack is : pro_input.getItemStackSet())
|
||||
for (ItemStack is : this.pro_input.getItemStackSet())
|
||||
{
|
||||
try
|
||||
{
|
||||
rc.rockCrusher( is, pro_output[0].getItemStack() );
|
||||
rc.rockCrusher( is, this.pro_output[0].getItemStack() );
|
||||
}
|
||||
catch (java.lang.RuntimeException err)
|
||||
{
|
||||
@@ -78,7 +78,7 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output );
|
||||
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,8 +46,8 @@ public class Grind implements ICraftHandler, IWebsiteSerializer
|
||||
int outs = output.get( 0 ).size();
|
||||
if ( input.get( 0 ).size() == 1 && outs == 1 )
|
||||
{
|
||||
pro_input = input.get( 0 ).get( 0 );
|
||||
pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
this.pro_input = input.get( 0 ).get( 0 );
|
||||
this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -57,20 +57,20 @@ public class Grind implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public void register() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
for (ItemStack is : pro_input.getItemStackSet())
|
||||
AEApi.instance().registries().grinder().addRecipe( is, pro_output[0].getItemStack(), 8 );
|
||||
for (ItemStack is : this.pro_input.getItemStackSet())
|
||||
AEApi.instance().registries().grinder().addRecipe( is, this.pro_output[0].getItemStack(), 8 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError {
|
||||
return Platform.isSameItemPrecise( pro_output[0].getItemStack(),output );
|
||||
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(),output );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPattern( RecipeHandler h ) {
|
||||
return "grind\n"+
|
||||
h.getName(pro_input)+ '\n' +
|
||||
h.getName(pro_output[0]);
|
||||
h.getName(this.pro_input)+ '\n' +
|
||||
h.getName(this.pro_output[0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer
|
||||
int outs = output.get( 0 ).size();
|
||||
if ( input.get( 0 ).size() == 1 && outs == 1 )
|
||||
{
|
||||
pro_input = input.get( 0 ).get( 0 );
|
||||
pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
this.pro_input = input.get( 0 ).get( 0 );
|
||||
this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -61,11 +61,11 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer
|
||||
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.FZ ) )
|
||||
{
|
||||
IFZ fz = (IFZ) AppEng.instance.getIntegration( IntegrationType.FZ );
|
||||
for (ItemStack is : pro_input.getItemStackSet())
|
||||
for (ItemStack is : this.pro_input.getItemStackSet())
|
||||
{
|
||||
try
|
||||
{
|
||||
fz.grinderRecipe( is, pro_output[0].getItemStack() );
|
||||
fz.grinderRecipe( is, this.pro_output[0].getItemStack() );
|
||||
}
|
||||
catch (java.lang.RuntimeException err)
|
||||
{
|
||||
@@ -78,7 +78,7 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output );
|
||||
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,8 +46,8 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer
|
||||
int outs = output.get( 0 ).size();
|
||||
if ( input.get( 0 ).size() == 1 && outs == 1 )
|
||||
{
|
||||
pro_input = input.get( 0 ).get( 0 );
|
||||
pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
this.pro_input = input.get( 0 ).get( 0 );
|
||||
this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -57,13 +57,13 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public void register() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
for (ItemStack beginStack : pro_input.getItemStackSet())
|
||||
for (ItemStack beginStack : this.pro_input.getItemStackSet())
|
||||
{
|
||||
try
|
||||
{
|
||||
NBTTagCompound toRegister = new NBTTagCompound();
|
||||
|
||||
ItemStack endStack = pro_output[0].getItemStack();
|
||||
ItemStack endStack = this.pro_output[0].getItemStack();
|
||||
|
||||
NBTTagCompound itemFrom = new NBTTagCompound();
|
||||
NBTTagCompound itemTo = new NBTTagCompound();
|
||||
@@ -87,7 +87,7 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output );
|
||||
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Inscribe implements ICraftHandler, IWebsiteSerializer
|
||||
this.usePlates = usePlates;
|
||||
this.plateA = plateA;
|
||||
this.plateB = plateB;
|
||||
output = out;
|
||||
this.output = out;
|
||||
}
|
||||
|
||||
final public boolean usePlates;
|
||||
@@ -77,12 +77,12 @@ public class Inscribe implements ICraftHandler, IWebsiteSerializer
|
||||
{
|
||||
if ( input.size() == 1 && input.get( 0 ).size() > 1 )
|
||||
{
|
||||
imprintable = input.get( 0 ).get( 0 );
|
||||
this.imprintable = input.get( 0 ).get( 0 );
|
||||
|
||||
plateA = input.get( 0 ).get( 1 );
|
||||
this.plateA = input.get( 0 ).get( 1 );
|
||||
|
||||
if ( input.get( 0 ).size() > 2 )
|
||||
plateB = input.get( 0 ).get( 2 );
|
||||
this.plateB = input.get( 0 ).get( 2 );
|
||||
|
||||
this.output = output.get( 0 ).get( 0 );
|
||||
}
|
||||
@@ -96,40 +96,40 @@ public class Inscribe implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public void register() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
if ( imprintable != null )
|
||||
Collections.addAll( inputs, imprintable.getItemStackSet() );
|
||||
if ( this.imprintable != null )
|
||||
Collections.addAll( inputs, this.imprintable.getItemStackSet() );
|
||||
|
||||
if ( plateA != null )
|
||||
Collections.addAll( plates, plateA.getItemStackSet() );
|
||||
if ( this.plateA != null )
|
||||
Collections.addAll( plates, this.plateA.getItemStackSet() );
|
||||
|
||||
if ( plateB != null )
|
||||
Collections.addAll( plates, plateB.getItemStackSet() );
|
||||
if ( this.plateB != null )
|
||||
Collections.addAll( plates, this.plateB.getItemStackSet() );
|
||||
|
||||
InscriberRecipe ir = new InscriberRecipe( imprintable.getItemStackSet(), plateA == null ? null : plateA.getItemStack(), plateB == null ? null
|
||||
: plateB.getItemStack(), output.getItemStack(), usePlates );
|
||||
InscriberRecipe ir = new InscriberRecipe( this.imprintable.getItemStackSet(), this.plateA == null ? null : this.plateA.getItemStack(), this.plateB == null ? null
|
||||
: this.plateB.getItemStack(), this.output.getItemStack(), this.usePlates );
|
||||
recipes.add( ir );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(ItemStack reqOutput) throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
return Platform.isSameItemPrecise( output.getItemStack(), reqOutput );
|
||||
return Platform.isSameItemPrecise( this.output.getItemStack(), reqOutput );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPattern(RecipeHandler h)
|
||||
{
|
||||
String o = "inscriber " + output.getQty() + '\n';
|
||||
String o = "inscriber " + this.output.getQty() + '\n';
|
||||
|
||||
o += h.getName( output ) + '\n';
|
||||
o += h.getName( this.output ) + '\n';
|
||||
|
||||
if ( plateA != null )
|
||||
o += h.getName( plateA )+ '\n';
|
||||
if ( this.plateA != null )
|
||||
o += h.getName( this.plateA )+ '\n';
|
||||
|
||||
o += h.getName(imprintable);
|
||||
o += h.getName(this.imprintable);
|
||||
|
||||
if ( plateB != null )
|
||||
o += '\n' +h.getName( plateB );
|
||||
if ( this.plateB != null )
|
||||
o += '\n' +h.getName( this.plateB );
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer
|
||||
int outs = output.get( 0 ).size();
|
||||
if ( input.get( 0 ).size() == 1 && outs == 1 )
|
||||
{
|
||||
pro_input = input.get( 0 ).get( 0 );
|
||||
pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
this.pro_input = input.get( 0 ).get( 0 );
|
||||
this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -61,11 +61,11 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer
|
||||
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.IC2 ) )
|
||||
{
|
||||
IIC2 ic2 = (IIC2) AppEng.instance.getIntegration( IntegrationType.IC2 );
|
||||
for (ItemStack is : pro_input.getItemStackSet())
|
||||
for (ItemStack is : this.pro_input.getItemStackSet())
|
||||
{
|
||||
try
|
||||
{
|
||||
ic2.maceratorRecipe( is, pro_output[0].getItemStack() );
|
||||
ic2.maceratorRecipe( is, this.pro_output[0].getItemStack() );
|
||||
}
|
||||
catch (java.lang.RuntimeException err)
|
||||
{
|
||||
@@ -78,7 +78,7 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output );
|
||||
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,8 +47,8 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer
|
||||
int outs = output.get( 0 ).size();
|
||||
if ( input.get( 0 ).size() == 1 && outs == 1 )
|
||||
{
|
||||
pro_input = input.get( 0 ).get( 0 );
|
||||
pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
this.pro_input = input.get( 0 ).get( 0 );
|
||||
this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -61,11 +61,11 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer
|
||||
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.Mekanism ) )
|
||||
{
|
||||
IMekanism rc = (IMekanism) AppEng.instance.getIntegration( IntegrationType.Mekanism );
|
||||
for (ItemStack is : pro_input.getItemStackSet())
|
||||
for (ItemStack is : this.pro_input.getItemStackSet())
|
||||
{
|
||||
try
|
||||
{
|
||||
rc.addCrusherRecipe( is, pro_output[0].getItemStack() );
|
||||
rc.addCrusherRecipe( is, this.pro_output[0].getItemStack() );
|
||||
}
|
||||
catch (java.lang.RuntimeException err)
|
||||
{
|
||||
@@ -78,7 +78,7 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output );
|
||||
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,8 +47,8 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer
|
||||
int outs = output.get( 0 ).size();
|
||||
if ( input.get( 0 ).size() == 1 && outs == 1 )
|
||||
{
|
||||
pro_input = input.get( 0 ).get( 0 );
|
||||
pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
this.pro_input = input.get( 0 ).get( 0 );
|
||||
this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -61,11 +61,11 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer
|
||||
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.Mekanism ) )
|
||||
{
|
||||
IMekanism rc = (IMekanism) AppEng.instance.getIntegration( IntegrationType.Mekanism );
|
||||
for (ItemStack is : pro_input.getItemStackSet())
|
||||
for (ItemStack is : this.pro_input.getItemStackSet())
|
||||
{
|
||||
try
|
||||
{
|
||||
rc.addEnrichmentChamberRecipe( is, pro_output[0].getItemStack() );
|
||||
rc.addEnrichmentChamberRecipe( is, this.pro_output[0].getItemStack() );
|
||||
}
|
||||
catch (java.lang.RuntimeException err)
|
||||
{
|
||||
@@ -78,7 +78,7 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output );
|
||||
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,18 +35,18 @@ public class OreRegistration implements ICraftHandler
|
||||
final String name;
|
||||
|
||||
public OreRegistration(List<IIngredient> in, String out) {
|
||||
inputs = in;
|
||||
name = out;
|
||||
this.inputs = in;
|
||||
this.name = out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
for (IIngredient i : inputs)
|
||||
for (IIngredient i : this.inputs)
|
||||
{
|
||||
for (ItemStack is : i.getItemStackSet())
|
||||
{
|
||||
OreDictionary.registerOre( name, is );
|
||||
OreDictionary.registerOre( this.name, is );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class Press extends Inscribe
|
||||
{
|
||||
|
||||
public Press() {
|
||||
usePlates = true;
|
||||
this.usePlates = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer
|
||||
int outs = output.get( 0 ).size();
|
||||
if ( input.get( 0 ).size() == 1 && outs == 1 )
|
||||
{
|
||||
pro_input = input.get( 0 ).get( 0 );
|
||||
pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
this.pro_input = input.get( 0 ).get( 0 );
|
||||
this.pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -60,9 +60,9 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer
|
||||
toSend.setInteger( "energy", 800 );
|
||||
toSend.setTag( "primaryOutput", new NBTTagCompound() );
|
||||
|
||||
pro_output[0].getItemStack().writeToNBT( toSend.getCompoundTag( "primaryOutput" ) );
|
||||
this.pro_output[0].getItemStack().writeToNBT( toSend.getCompoundTag( "primaryOutput" ) );
|
||||
|
||||
for (ItemStack is : pro_input.getItemStackSet())
|
||||
for (ItemStack is : this.pro_input.getItemStackSet())
|
||||
{
|
||||
toSend.setTag( "input", new NBTTagCompound() );
|
||||
is.writeToNBT( toSend.getCompoundTag( "input" ) );
|
||||
@@ -73,7 +73,7 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output );
|
||||
return Platform.isSameItemPrecise( this.pro_output[0].getItemStack(), output );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,21 +50,21 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
|
||||
{
|
||||
if ( output.size() == 1 && output.get( 0 ).size() == 1 )
|
||||
{
|
||||
rows = input.size();
|
||||
if ( rows > 0 && input.size() <= 3 )
|
||||
this.rows = input.size();
|
||||
if ( this.rows > 0 && input.size() <= 3 )
|
||||
{
|
||||
cols = input.get( 0 ).size();
|
||||
if ( cols <= 3 && cols >= 1 )
|
||||
this.cols = input.get( 0 ).size();
|
||||
if ( this.cols <= 3 && this.cols >= 1 )
|
||||
{
|
||||
for (List<IIngredient> anInput : input)
|
||||
{
|
||||
if ( anInput.size() != cols )
|
||||
if ( anInput.size() != this.cols )
|
||||
{
|
||||
throw new RecipeError( "all rows in a shaped crafting recipe must contain the same number of ingredients." );
|
||||
}
|
||||
}
|
||||
|
||||
inputs = input;
|
||||
this.inputs = input;
|
||||
this.output = output.get( 0 ).get( 0 );
|
||||
}
|
||||
else
|
||||
@@ -83,18 +83,18 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
|
||||
char first = 'A';
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
|
||||
for (int y = 0; y < rows; y++)
|
||||
for (int y = 0; y < this.rows; y++)
|
||||
{
|
||||
StringBuilder row = new StringBuilder();
|
||||
for (int x = 0; x < cols; x++)
|
||||
for (int x = 0; x < this.cols; x++)
|
||||
{
|
||||
if ( inputs.get( y ).get( x ).isAir() )
|
||||
if ( this.inputs.get( y ).get( x ).isAir() )
|
||||
row.append( ' ' );
|
||||
else
|
||||
{
|
||||
row.append( first );
|
||||
args.add( first );
|
||||
args.add( inputs.get( y ).get( x ) );
|
||||
args.add( this.inputs.get( y ).get( x ) );
|
||||
|
||||
first++;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
|
||||
args.add( y, row.toString() );
|
||||
}
|
||||
|
||||
ItemStack outIS = output.getItemStack();
|
||||
ItemStack outIS = this.output.getItemStack();
|
||||
|
||||
try
|
||||
{
|
||||
@@ -118,10 +118,10 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public boolean canCraft(ItemStack reqOutput) throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
for (int y = 0; y < rows; y++)
|
||||
for (int x = 0; x < cols; x++)
|
||||
for (int y = 0; y < this.rows; y++)
|
||||
for (int x = 0; x < this.cols; x++)
|
||||
{
|
||||
IIngredient i = inputs.get( y ).get( x );
|
||||
IIngredient i = this.inputs.get( y ).get( x );
|
||||
|
||||
if ( !i.isAir() )
|
||||
{
|
||||
@@ -133,25 +133,25 @@ public class Shaped implements ICraftHandler, IWebsiteSerializer
|
||||
}
|
||||
}
|
||||
|
||||
return Platform.isSameItemPrecise( output.getItemStack(), reqOutput );
|
||||
return Platform.isSameItemPrecise( this.output.getItemStack(), reqOutput );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPattern(RecipeHandler h)
|
||||
{
|
||||
String o = "shaped " + output.getQty() + ' ' + cols + 'x' + rows + '\n';
|
||||
String o = "shaped " + this.output.getQty() + ' ' + this.cols + 'x' + this.rows + '\n';
|
||||
|
||||
o += h.getName( output ) + '\n';
|
||||
o += h.getName( this.output ) + '\n';
|
||||
|
||||
for (int y = 0; y < rows; y++)
|
||||
for (int x = 0; x < cols; x++)
|
||||
for (int y = 0; y < this.rows; y++)
|
||||
for (int x = 0; x < this.cols; x++)
|
||||
{
|
||||
IIngredient i = inputs.get( y ).get( x );
|
||||
IIngredient i = this.inputs.get( y ).get( x );
|
||||
|
||||
if ( i.isAir() )
|
||||
o += "air" + (x + 1 == cols ? "\n" : " ");
|
||||
o += "air" + (x + 1 == this.cols ? "\n" : " ");
|
||||
else
|
||||
o += h.getName( i ) + (x + 1 == cols ? "\n" : " ");
|
||||
o += h.getName( i ) + (x + 1 == this.cols ? "\n" : " ");
|
||||
}
|
||||
|
||||
return o.trim();
|
||||
|
||||
@@ -49,7 +49,7 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer
|
||||
{
|
||||
if ( input.size() == 1 )
|
||||
{
|
||||
inputs = input.get( 0 );
|
||||
this.inputs = input.get( 0 );
|
||||
this.output = output.get( 0 ).get( 0 );
|
||||
}
|
||||
else
|
||||
@@ -63,10 +63,10 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer
|
||||
public void register() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
for (IIngredient i : inputs)
|
||||
for (IIngredient i : this.inputs)
|
||||
args.add( i );
|
||||
|
||||
ItemStack outIS = output.getItemStack();
|
||||
ItemStack outIS = this.output.getItemStack();
|
||||
|
||||
try
|
||||
{
|
||||
@@ -83,7 +83,7 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer
|
||||
public boolean canCraft(ItemStack reqOutput) throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
|
||||
for (IIngredient i : inputs)
|
||||
for (IIngredient i : this.inputs)
|
||||
{
|
||||
if ( !i.isAir() )
|
||||
{
|
||||
@@ -97,19 +97,19 @@ public class Shapeless implements ICraftHandler, IWebsiteSerializer
|
||||
}
|
||||
}
|
||||
|
||||
return Platform.isSameItemPrecise( output.getItemStack(), reqOutput );
|
||||
return Platform.isSameItemPrecise( this.output.getItemStack(), reqOutput );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPattern(RecipeHandler h)
|
||||
{
|
||||
StringBuilder o = new StringBuilder( "shapeless " + output.getQty() + '\n' );
|
||||
StringBuilder o = new StringBuilder( "shapeless " + this.output.getQty() + '\n' );
|
||||
|
||||
o.append( h.getName( output ) ).append( '\n' );
|
||||
o.append( h.getName( this.output ) ).append( '\n' );
|
||||
|
||||
for (int y = 0; y < inputs.size(); y++)
|
||||
for (int y = 0; y < this.inputs.size(); y++)
|
||||
{
|
||||
IIngredient i = inputs.get( y );
|
||||
IIngredient i = this.inputs.get( y );
|
||||
|
||||
if ( i.isAir() )
|
||||
{
|
||||
|
||||
@@ -48,8 +48,8 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer
|
||||
List<IIngredient> outputList = output.get( 0 );
|
||||
if ( inputList.size() == 1 && outputList.size() == 1 )
|
||||
{
|
||||
in = inputList.get( 0 );
|
||||
out = outputList.get( 0 );
|
||||
this.in = inputList.get( 0 );
|
||||
this.out = outputList.get( 0 );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -59,24 +59,24 @@ public class Smelt implements ICraftHandler, IWebsiteSerializer
|
||||
@Override
|
||||
public void register() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
if ( in.getItemStack().getItem() == null )
|
||||
throw new RegistrationError( in.toString() + ": Smelting Input is not a valid item." );
|
||||
if ( this.in.getItemStack().getItem() == null )
|
||||
throw new RegistrationError( this.in.toString() + ": Smelting Input is not a valid item." );
|
||||
|
||||
if ( out.getItemStack().getItem() == null )
|
||||
throw new RegistrationError( out.toString() + ": Smelting Output is not a valid item." );
|
||||
if ( this.out.getItemStack().getItem() == null )
|
||||
throw new RegistrationError( this.out.toString() + ": Smelting Output is not a valid item." );
|
||||
|
||||
GameRegistry.addSmelting( in.getItemStack(), out.getItemStack(), 0 );
|
||||
GameRegistry.addSmelting( this.in.getItemStack(), this.out.getItemStack(), 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(ItemStack reqOutput) throws RegistrationError, MissingIngredientError {
|
||||
return Platform.isSameItemPrecise( out.getItemStack(),reqOutput );
|
||||
return Platform.isSameItemPrecise( this.out.getItemStack(),reqOutput );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPattern( RecipeHandler h ) {
|
||||
return "smelt "+out.getQty()+ '\n' +
|
||||
h.getName(out)+ '\n' +
|
||||
h.getName(in);
|
||||
return "smelt "+this.out.getQty()+ '\n' +
|
||||
h.getName(this.out)+ '\n' +
|
||||
h.getName(this.in);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,13 +31,13 @@ public class ConfigLoader implements IRecipeLoader
|
||||
private final String rootPath;
|
||||
|
||||
public ConfigLoader(String s) {
|
||||
rootPath = s;
|
||||
this.rootPath = s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedReader getFile(String s) throws Exception
|
||||
{
|
||||
File f = new File( rootPath + s );
|
||||
File f = new File( this.rootPath + s );
|
||||
return new BufferedReader( new InputStreamReader( new FileInputStream( f ), "UTF-8" ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +29,13 @@ public class JarLoader implements IRecipeLoader
|
||||
private final String rootPath;
|
||||
|
||||
public JarLoader(String s) {
|
||||
rootPath = s;
|
||||
this.rootPath = s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedReader getFile(String s) throws Exception
|
||||
{
|
||||
return new BufferedReader( new InputStreamReader( getClass().getResourceAsStream( rootPath + s ), "UTF-8" ) );
|
||||
return new BufferedReader( new InputStreamReader( this.getClass().getResourceAsStream( this.rootPath + s ), "UTF-8" ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,14 +54,14 @@ public class OreDictionaryHandler
|
||||
if ( event.Name == null || event.Ore == null )
|
||||
return;
|
||||
|
||||
if ( shouldCare( event.Name ) )
|
||||
if ( this.shouldCare( event.Name ) )
|
||||
{
|
||||
for (IOreListener v : ol)
|
||||
for (IOreListener v : this.ol)
|
||||
v.oreRegistered( event.Name, event.Ore );
|
||||
}
|
||||
|
||||
if ( enableRebaking )
|
||||
bakeRecipes();
|
||||
if ( this.enableRebaking )
|
||||
this.bakeRecipes();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,12 +72,12 @@ public class OreDictionaryHandler
|
||||
*/
|
||||
public void observe(IOreListener n)
|
||||
{
|
||||
ol.add( n );
|
||||
this.ol.add( n );
|
||||
|
||||
// notify the listener of any ore already in existence.
|
||||
for (String name : OreDictionary.getOreNames())
|
||||
{
|
||||
if ( name != null && shouldCare( name ) )
|
||||
if ( name != null && this.shouldCare( name ) )
|
||||
{
|
||||
for (ItemStack item : OreDictionary.getOres( name ))
|
||||
{
|
||||
@@ -90,7 +90,7 @@ public class OreDictionaryHandler
|
||||
|
||||
public void bakeRecipes()
|
||||
{
|
||||
enableRebaking = true;
|
||||
this.enableRebaking = true;
|
||||
|
||||
for (Object o : CraftingManager.getInstance().getRecipeList())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user