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

ItemMeta Serialization Does Not Correctly Work with itemstack.isSimilar()

XMLWordPrintable

    •  git-Spigot-57bbdd8-dea4138 (MC: 1.16.3) (Implementing API version 1.16.3-R0.1-SNAPSHOT)
    • Yes

      Steps to reproduce the issue:

      1. Give a user a custom item in game: 

      /give @p carrot_on_a_stick{display:{Name:'{"text":"Credit Coupon #01","color":"aqua"}',Lore:['{"text":"Exchange for $100"}','{"text":"Coupon ID #01"}']},Unbreakable:1b,CustomModelData:1} 1
      

      2. Save the item to a yaml file

      item:
              ==: org.bukkit.inventory.ItemStack
              v: 2580
              type: CARROT_ON_A_STICK
              meta:
                ==: ItemMeta
                meta-type: UNSPECIFIC
                display-name: '§bCredit Coupon #01'
                lore:
                - Exchange for $100
                - 'Coupon ID #01'
                custom-model-data: 1
                Unbreakable: true
      

      3. Load the item from the yaml file.

      All attributes appear to be loaded into the object correctly and it appears to be an exact copy of the original item.

      4. Call originalItemStack.isSimilar(loadedItemStack)

      I would expect this to return true but it returns false. Both items have been unchanged and appear to be perfect clones of one another but for whatever reason the isSimilar() method of ItemStack in Spigot returns false.

       

            Unassigned Unassigned
            SnowGears SnowGears
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: