ChestShop-authors / ChestShop-3

ChestShop - the chest & sign shop plugin for Minecraft Servers running Bukkit/Spigot/Paper
https://dev.bukkit.org/projects/chestshop
GNU Lesser General Public License v2.1
275 stars 176 forks source link

two items names for one item #468

Open seema84 opened 3 years ago

seema84 commented 3 years ago

Plugin Version

ChestShop's version is: 3.12 (build 307)

Server Version

Paper version git-Paper-783 (MC: 1.16.5)

What other plugins are you running?

Chestshop

What is happening?

some items have 2 different item names

What did you expect to happen?

one item name for every item

Additional context

shop23

Phoenix616 commented 3 years ago

Please provide your items.db file as well as the nbt data of the item in question.

seema84 commented 3 years ago

items.zip

how i get the nbt data of this item?

Phoenix616 commented 3 years ago

The easiest would be to put the item into a chest and use the /data get command on it.

seema84 commented 3 years ago

{z: -385, id: "minecraft:chest", y: 62, x: -16, Items: [{Slot: 1b, id: "minecraft:enchanted_book", tag: {StoredEnchantments: [{id: "minecraft:protection", lvl: 3s}, {id: "minecraft:power", lvl: 4s}]}, Count: 1b}]}

Phoenix616 commented 3 years ago

According to your items.db file those are not the same items. (The enchantment order is different) Did you really only use one item stack? (Any kind of action of a different plugin might've modified it, it should've printed the new ID in /iteminfo too though)

seema84 commented 3 years ago

In the store there is only one enchanted book. If I enter the ID which shows /iteminfo, then the store changes the ID to another one by itself (as you can see on the picture). This does not only affect this one item/shop. I can buy this book with both IDs (#9k and #9l). This behavior seems to be quite new.

Phoenix616 commented 3 years ago

Basically your issue is that something changed the order of the NBT data of your item (or at least the order that is used when serialising the Item to YAML which is used to store the item data inside the DB) Such a thing can happen either due to some server-internal conversion code or due to some plugin modifying the item which might trigger it.

I suggest to just ignore it as there isn't really a good way to stop that or (efficiently) find similar items in the db, shops shouldn't break due to this as the comparison code catches a lot of cases where the item info is the same but ordered differently internally.