Add Ore Dictionary support for Assembly Recipes

This commit is contained in:
taelnia 2013-11-15 21:07:15 -05:00
parent 696c206792
commit 3d1815595b

View file

@ -2,6 +2,7 @@ package buildcraft.api.recipes;
import java.util.LinkedList; import java.util.LinkedList;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class AssemblyRecipe { public class AssemblyRecipe {
@ -35,6 +36,16 @@ public class AssemblyRecipe {
if (item.isItemEqual(in)) { if (item.isItemEqual(in)) {
found += item.stackSize; // Adds quantity of stack to amount found += item.stackSize; // Adds quantity of stack to amount
// found // found
} else {
int oreID = OreDictionary.getOreID(in);
if (oreID >= 0) {
for (ItemStack oreItem : OreDictionary.getOres(oreID)) {
if(OreDictionary.itemMatches(oreItem, item, false)) {
found += item.stackSize;
break;
}
}
}
} }
} }