Cleanup a bit of infusion code (#5493)

* Cleanup a bit of infusion code

* Empty item stacks already return 0 for their count

* Go back to not assuming null and empty tag are the same

* Reorder which order the arguments are passed to equalsWildcard for consistency with the rest of the class as it is a symmetrical method anyways
This commit is contained in:
Richard Freimer authored and GitHub committed 2019-05-27 12:51:50 -04:00
1 parent eb2de11b72
commit 72951d2c66
7 files changed
+54 -40

No files matched your search

@@ -55,9 +55,10 @@ public class InfusionInput extends MachineInput<InfusionInput> implements IWildI
}
public boolean use(NonNullList<ItemStack> inventory, int index, InfuseStorage infuseStorage, boolean deplete) {
if (inputContains(inventory.get(index), inputStack) && infuseStorage.contains(infuse)) {
ItemStack stack = inventory.get(index);
if (inputContains(stack, inputStack) && infuseStorage.contains(infuse)) {
if (deplete) {
inventory.set(index, StackUtils.subtract(inventory.get(index), inputStack));
inventory.set(index, StackUtils.subtract(stack, inputStack));
infuseStorage.subtract(infuse);
}
return true;