Re-did DuplicateItems, into Ore Camo Feature, better logic, and better config.

This commit is contained in:
AlgorithmX2
2014-08-02 18:09:41 -05:00
parent 7ccb850037
commit 476d9a478a
15 changed files with 226 additions and 72 deletions
+21 -4
View File
@@ -17,6 +17,12 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
private ItemStack output = null;
private ArrayList<Object> input = new ArrayList<Object>();
private boolean disable = false;
public boolean isEnabled()
{
return !disable;
}
public ShapelessRecipe(ItemStack result, Object... recipe) {
output = result.copy();
@@ -61,6 +67,9 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
@Override
public boolean matches(InventoryCrafting var1, World world)
{
if ( disable )
return false;
ArrayList<Object> required = new ArrayList<Object>( input );
for (int x = 0; x < var1.getSizeInventory(); x++)
@@ -82,7 +91,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
{
try
{
for (ItemStack item : ((IIngredient) next).getItemStackSet() )
for (ItemStack item : ((IIngredient) next).getItemStackSet())
{
match = match || checkItemEquals( item, slot );
}
@@ -135,10 +144,18 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
@Override
public void bake() throws RegistrationError, MissingIngredientError
{
for ( Object o : getInput() )
try
{
if ( o instanceof IIngredient )
((IIngredient)o).bake();
disable = false;
for (Object o : getInput())
{
if ( o instanceof IIngredient )
((IIngredient) o).bake();
}
}
catch (MissingIngredientError e)
{
disable = true;
}
}
}