clean up ore dict improvements

This commit is contained in:
way2muchnoise
2016-11-02 21:04:25 +01:00
parent feff746431
commit 60bf5fc336
2 changed files with 9 additions and 4 deletions

View File

@@ -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);

View File

@@ -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);