Create custom shapeless recipe matching system. Should solve #4516 damageable items in shapeless recipes.

This commit is contained in:
LexManos committed 2017-11-22 13:26:02 -08:00
1 parent ad16f15365
commit 89db87dbfc
11 files changed
+368 -19

No files matched your search

@@ -20,11 +20,17 @@ public class CompoundIngredient extends Ingredient
private Collection<Ingredient> children;
private ItemStack[] stacks;
private IntList itemIds;
private final boolean isSimple;
protected CompoundIngredient(Collection<Ingredient> children)
{
super(0);
this.children = children;
boolean simple = true;
for (Ingredient child : children)
simple &= child.isSimple();
this.isSimple = simple;
}
@Override
@@ -78,4 +84,10 @@ public class CompoundIngredient extends Ingredient
this.stacks = null;
//Shouldn't need to invalidate children as this is only called form invalidateAll..
}
@Override
public boolean isSimple()
{
return isSimple;
}
}
@@ -40,4 +40,10 @@ public class IngredientNBT extends Ingredient
//Can't use areItemStacksEqualUsingNBTShareTag because it compares stack size as well
return this.stack.getItem() == input.getItem() && this.stack.getItemDamage() == input.getItemDamage() && ItemStack.areItemStackShareTagsEqual(this.stack, input);
}
@Override
public boolean isSimple()
{
return false;
}
}