Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7654

ItemStack#isSimilar does not work with empty BlockStateMeta

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • doesn't matter

      Some calls to ItemStack#isSimilar returning false, although the item should be the same.

      I've only tested this scenario, where a ItemStack#isSimilar compares two items from clicking inside an inventory. After checking what's causing this, it looks like the CraftMetaBlockState is checking the blockEntityTag of both metas and they are different. Not sure, what's exactly the cause of this issue, but I belive it's not wanted, as the code worked in 1.20.4.

       

      Code: https://pastebin.com/juP2u7Wd

      Me, trying to figure out, what's wrong:

       

      Expected Behaviour: The two items should be the same (isSimilar = true, console output = true)

      Observed Beahviour (1.20.6): The two items appear to be not the same (isSimilar = false, console output = false)

            Unassigned Unassigned
            MrKinau David Lüdtke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: