Shopkeeper enchanted and spawn egg trades must be set back up after restart
FatherWh0 opened this issue ยท 9 comments
Preliminaries:
Shopkeepers v2.6.0
paper 1.13.2 614
After each server restart all shopkeeper trades for enchanted items and spawn eggs turn to red X's as if the items have been replaced with new, different items. I have to delete the items and reset the trades on all enchanted items and spawn eggs. Pls see images.
https://prnt.sc/nbyk1e
https://prnt.sc/nbyk5w
http://prntscr.com/nbymvz
Please note the items in the images have not changed. The server is simply restarted and it behaves as if they are different items.
Only enchanted item and spawn egg trades are effected by this.
Yes they are player shopkeepers. They were created with our configured creation item which is and end portal item frame.
Some of the enchanted items were each given one or two enchants with the EssentialsX command /enchant such as /enchant efficiency 10 then the rest of the enchants were added with vanilla books and anvil. Other items were only given enchants with the vanilla book and anvil. The spawn eggs were originally pulled from the vanilla creative menu then traded through an admin shopkeeper.
They were created with our configured creation item which is and end portal item frame.
I meant: How did you create those items? Can you provide me instructions (vanilla command or plugin) used to create those specific items which are causing issues?
I assume the items are no longer the same after getting serialized and deserialized to/from the save.yml file. This would be an indication that the original items' data is in a non-standard / unexpected / non-spigot format.
I was able to reproduce this for damageable items (armor, tools, ..), but not for the spawn eggs extracted from the creative menu. Do your spawn eggs contain any additional data?
Regarding the damageable items: This seems to be a Spigot / Vanilla bug. Minecraft (and Spigot) will omit the 'Damage' tag when the item is undamaged, but Minecraft will add that tag neverthelss in other situations (like when loading the ItemStack in the chest from the chunk data). If the item also contains other data (such as enchantments), this change will result in the items with and without the internal Damage tag to be considered different.
I have prepared a PR for Spigot which should fix this: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/544/
I found the issue with the spawn eggs. They were created in 1.12.2. When I replaced them with eggs pulled from the creative menu in 1.13.2 the issue with the eggs disappeared.
Thank you for your help with this matter.
Odd. I would expect the spawn egg items in the trades to get converted by Spigot when they get loaded from the save.yml file. If the result of this conversion doesn't match the items converted by minecraft inside the chest that might indicate some issue in Spigot.
Please let me know if the Spigot changes have fixed your issue once you are able to test this.