Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -846,18 +846,13 @@ public ItemStack getCraftResult(IProgram program) {
}

private ItemStack findCraftingCard(IItemHandler handler, ItemStack craftResult) {
String resultNBT = "";
if (craftResult.hasTagCompound()) {
resultNBT = craftResult.serializeNBT().toString();
}
for (int j = 0 ; j < handler.getSlots() ; j++) {
ItemStack s = handler.getStackInSlot(j);
if (ItemStackTools.isValid(s) && s.getItem() == ModItems.craftingCardItem) {
ItemStack result = CraftingCardItem.getResult(s);

if (ItemStackTools.isValid(result) && result.isItemEqual(craftResult)) {
if (craftResult.hasTagCompound()) {
if (resultNBT.equalsIgnoreCase(result.serializeNBT().toString())) {
if (ItemStack.areItemStackTagsEqual(craftResult, result)) {
return s;
}
} else {
Expand Down
10 changes: 1 addition & 9 deletions src/main/java/mcjty/rftoolscontrol/logic/InventoryTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,7 @@ public static ItemStack extractItem(@Nullable IItemHandler itemHandler, @Nullabl
public static boolean isEqualAdvanced(ItemStack itemMatcher, ItemStack stack, boolean strictnbt) {
if (ItemStackTools.isValid(stack) && ItemStack.areItemsEqual(stack, itemMatcher)) {
if (strictnbt) {
if (itemMatcher.hasTagCompound() || stack.hasTagCompound()) {
String t1 = itemMatcher.serializeNBT().toString();
String t2 = stack.serializeNBT().toString();
if (t1.equalsIgnoreCase(t2)) {
return true;
}
} else {
return true;
}
return (!itemMatcher.hasTagCompound() || ItemStack.areItemStackTagsEqual(stack, itemMatcher));
} else {
return true;
}
Expand Down