Fix a bug in NBT usage (#127)

This commit is contained in:
初夏同学 authored and GitHub committed 2023-07-05 17:57:26 +02:00
1 parent 1717d38632
commit ebcbef851a
1 file changed
+4 -3
@@ -96,9 +96,10 @@ public class TileEntityPainter extends AbstractPoweredTaskEntity implements ISid
// 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;
}