only use the stripped stack for comparing since it messes up item detection, fixes #766

This commit is contained in:
raoulvdberge
2016-12-22 02:38:43 +01:00
parent 9b1b52daea
commit cc41c0d7d9

View File

@@ -143,14 +143,14 @@ public abstract class CraftingStep implements ICraftingStep {
@Override @Override
public boolean onReceiveOutput(ItemStack stack) { public boolean onReceiveOutput(ItemStack stack) {
stack = Comparer.stripTags(stack.copy()); ItemStack compareStack = Comparer.stripTags(stack.copy());
for (ItemStack output : pattern.getOutputs()) { for (ItemStack output : pattern.getOutputs()) {
int hashcode = API.instance().getItemStackHashCode(output); int hashcode = API.instance().getItemStackHashCode(output);
Integer received = satisfied.get(hashcode); Integer received = satisfied.get(hashcode);
if (received == null) { if (received == null) {
received = 0; received = 0;
} }
if (API.instance().getComparer().isEqual(stack, output, CraftingTask.DEFAULT_COMPARE | (getPattern().isOredict() ? IComparer.COMPARE_OREDICT : 0))) { if (API.instance().getComparer().isEqual(compareStack, output, CraftingTask.DEFAULT_COMPARE | (getPattern().isOredict() ? IComparer.COMPARE_OREDICT : 0))) {
if (received < output.getCount()) { if (received < output.getCount()) {
int toReceive = Math.min(output.getCount() - received, stack.getCount()); int toReceive = Math.min(output.getCount() - received, stack.getCount());
satisfied.put(hashcode, received + toReceive); satisfied.put(hashcode, received + toReceive);