Check NBT for factory sorting. Fixes #5436

This commit is contained in:
pupnewfster committed 2019-04-27 14:55:34 -04:00
1 parent 99977f8814
commit dccc32db85
2 files changed
+6 -9

No files matched your search

@@ -67,6 +67,7 @@ import net.minecraft.util.NonNullList;
import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.items.ItemHandlerHelper;
public class TileEntityFactory extends TileEntityMachine implements IComputerIntegration, ISideConfiguration,
IGasHandler, ISpecialConfigData, ITierUpgradeable, ISustainedData {
@@ -404,7 +405,11 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt
for (int j = i + 1; j < inputSlots.length; j++) {
int checkSlotID = inputSlots[j];
ItemStack checkStack = inventory.get(checkSlotID);
if (StackUtils.diffIgnoreEmpty(stack, checkStack) || Math.abs(count - checkStack.getCount()) < 2) {
if (Math.abs(count - checkStack.getCount()) < 2) {
continue;
}
if (!stack.isEmpty() && !checkStack.isEmpty() && !ItemHandlerHelper
.canItemStacksStack(stack, checkStack)) {
continue;
}
//Output/Input will not match
@@ -9,14 +9,6 @@ import net.minecraftforge.oredict.OreDictionary;
public final class StackUtils {
//only used in factory
public static boolean diffIgnoreEmpty(ItemStack stack1, ItemStack stack2) {
if (stack1.isEmpty() || stack2.isEmpty()) {
return false;
}
return stack1.getItem() != stack2.getItem() || stack1.getItemDamage() != stack2.getItemDamage();
}
//ignores count
public static boolean equalsWildcard(ItemStack wild, ItemStack check) {
if (wild.isEmpty() || check.isEmpty()) {