clean up ore dict improvements
This commit is contained in:
@@ -56,8 +56,7 @@ public class CraftingPattern implements ICraftingPattern {
|
||||
Object[] inputs = new Object[0];
|
||||
if (shapedOre) {
|
||||
inputs = ((ShapedOreRecipe) recipe).getInput();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
try {
|
||||
inputs = (Object[]) recipe.getClass().getMethod("getInput").invoke(recipe);
|
||||
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
|
||||
@@ -67,8 +66,7 @@ public class CraftingPattern implements ICraftingPattern {
|
||||
for (Object input : inputs) {
|
||||
if (input == null) {
|
||||
oreInputs.add(Collections.emptyList());
|
||||
}
|
||||
if (input instanceof ItemStack) {
|
||||
} else if (input instanceof ItemStack) {
|
||||
oreInputs.add(Collections.singletonList((ItemStack) input));
|
||||
} else {
|
||||
oreInputs.add((List<ItemStack>)input);
|
||||
|
@@ -76,6 +76,13 @@ public class CraftingStepCraft extends CraftingStep {
|
||||
IItemStackList actualInputs = API.instance().createItemStackList();
|
||||
int compare = CraftingTask.DEFAULT_COMPARE | (getPattern().isOredict() ? IComparer.COMPARE_OREDICT : 0);
|
||||
for (ItemStack insertStack : getToInsert()) {
|
||||
// This will be a tool, like a hammer
|
||||
if (insertStack.isItemStackDamageable()) {
|
||||
compare &= ~IComparer.COMPARE_DAMAGE;
|
||||
} else {
|
||||
compare |= IComparer.COMPARE_DAMAGE;
|
||||
}
|
||||
|
||||
FluidStack fluidInItem = RSUtils.getFluidFromStack(insertStack, true);
|
||||
if (fluidInItem != null) {
|
||||
network.extractFluid(fluidInItem, fluidInItem.amount, compare);
|
||||
|
Reference in New Issue
Block a user