Reworked recipe oredict checks, should fix #72.

This commit is contained in:
Vasco Lavos committed 2014-05-28 15:59:40 +01:00
1 parent 6400724d70
commit 54ae8c8109
2 files changed
+26 -5

No files matched your search

@@ -35,9 +35,15 @@ public class RecipeManaInfusion {
if(input instanceof String) {
List<ItemStack> validStacks = OreDictionary.getOres((String) input);
for(ItemStack stack_ : validStacks)
if(stack.isItemEqual(stack_))
for(ItemStack ostack : validStacks) {
ItemStack cstack = ostack.copy();
if(cstack.getItemDamage() == Short.MAX_VALUE)
cstack.setItemDamage(stack.getItemDamage());
if(stack.isItemEqual(cstack))
return true;
}
}
return false;
@@ -50,9 +50,24 @@ public class RecipePetals {
for(int j = 0; j < inputsMissing.size(); j++) {
Object input = inputsMissing.get(j);
if(input instanceof String && input.equals(oredict)) {
oredictIndex = j;
break;
if(input instanceof String) {
List<ItemStack> validStacks = OreDictionary.getOres((String) input);
boolean found = false;
for(ItemStack ostack : validStacks) {
ItemStack cstack = ostack.copy();
if(cstack.getItemDamage() == Short.MAX_VALUE)
cstack.setItemDamage(stack.getItemDamage());
if(stack.isItemEqual(cstack)) {
oredictIndex = j;
found = true;
break;
}
}
if(found)
break;
} else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) {
stackIndex = j;
break;