Skip to content

Commit

Permalink
Fix a bug in NBT usage (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
wohaopa authored Jul 5, 2023
1 parent 1717d38 commit ebcbef8
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ protected int getNumCanMerge(ItemStack itemStack, ItemStack result) {
// next result is a different item type
return 0;
} else if (result.hasTagCompound() && inventory[2].hasTagCompound()) {
int cookedId = result.getTagCompound().getInteger(BlockPainter.KEY_SOURCE_BLOCK_ID);
int invId = inventory[2].getTagCompound().getInteger(BlockPainter.KEY_SOURCE_BLOCK_ID);
if (cookedId != invId) {
if (inventory[2].getTagCompound().hasKey("Items")) return 0; // presence of internal items
String cookedId = result.getTagCompound().getString(BlockPainter.KEY_SOURCE_BLOCK_ID);
String invId = inventory[2].getTagCompound().getString(BlockPainter.KEY_SOURCE_BLOCK_ID);
if (!cookedId.equals(invId)) {
// next result has a different source item than the current one
return 0;
}
Expand Down

0 comments on commit ebcbef8

Please sign in to comment.