Add Ore Dictionary support for Assembly Recipes
This commit is contained in:
parent
696c206792
commit
3d1815595b
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue