-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ItemStack serialized to YAML with "internal" tag breaks on 1.20.6 > 1.21.1 update #11423
Comments
This is likely unmitigable in a reasonable manner and reason 101 as to why I've been advising against using YAML for serialising ItemStacks |
Thanks for a swift response! Please consider adding just this one key, it's heavily used among many plugins, including NBT-API. This broke a lot of plugins not just mine, I believe the purpose of Bukkit is to mitigate these even at the expense of manual/duplicated code, see a lot of enums are being manually kept up. Thanks for the consideration. |
There is no structure here to run through DFU. We could maybe create a means for handling known keys, but for anything else, all we could maybe try to do is transpose them over to the custom data component. However, I'm not sure that there is much desire to invest much effort into this broken form of Item persistence. #10609 - will likely be the solution here, but that will not deal with situations upstream has not handled on upgrades. ItemMeta is highly broken, especially when it comes to serialisation; this is why I've been warning against it for eons. The best you can probably do is release an update for older versions to migrate the format to something sane and then get people to upgrade. |
Gotcha. I got it fixed in my own library nice and dirty way, but I agree with what you said, unfortunately keeping up 1.8.8-1.21 support is not straightforward. I propose you add a dirty fix for this for now, and in the future move towards a hard paper fork, get rid of all the deprecations etc., essentially force plugin authors to develop against paper, which would solve a lot of issues. Here is my code for the record, it actually implements a whole custom yaml parser inspired by bukkit:
|
Expected behavior
The "internal" tag will continue to work...
Observed/Actual behavior
The tag is lost upon loading and storing the ItemStack, as it now seems to be renamed to "custom" without automatic migration
Steps/models to reproduce
Given the below yaml output, load it as itemstack and save it again on 1.21.1
Plugin and Datapack List
N/A
Paper version
This server is running Paper version 1.21.1-85-master@c5a1066 (2024-09-19T14:47:47Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)
Other
I managed to "fix" this by manually replacing "internal" with "custom", however that should be dealt with automatically. CraftMetaItem seems to contain support for both, not sure why it no longer works.
Thanks!
The text was updated successfully, but these errors were encountered: