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