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

ItemStack#isSimilar fails in 1.20.5 but works in 1.20.4

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • None
    • None
    • This server is running CraftBukkit version 4132-Spigot-b698b49-91b1fc3 (MC: 1.20.5) (Implementing API version 1.20.5-R0.1-SNAPSHOT)
    • Yes

      I have a plugin that players can get a custom item called `Chunk Buster`. When a player gets one and places it on ground, my plugin tries to look for the matching ChunkBuster object by checking for the similar item (using ItemStack#isSimilar).

      However, something is wrong in 1.20.5. In 1.20.4, the plugin matches a correct item:
      https://pastebin.com/6hBqKUz6
      In 1.20.5 on the other hand, it fails as shown here:
      https://pastebin.com/yyJch82m

      The hash and toString of the ItemStacks are similar, yet in 1.20.5 the isSimilar returns false.
      It seems like the durability of the item changed.
      Even if I give myself the item again, it seems to not work.

      The following code also doesn't seem to print anything:
      https://pastebin.com/zbAasLVg

            Unassigned Unassigned
            Ome_R Omer Ben Gera
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: