-
Notifications
You must be signed in to change notification settings - Fork 153
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
Get rid of deprecated metadata #628
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good aside from that. Yet not tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☑️ Battery box works. Charge gets migrated
☑️ Can level works and gets migrated
☑️ Chain saw works and gets migrated
Flashlight works but seems to be bugged (discharges too quickly), not a problem introduced by this PR.
☑️ Prospector works
☑️ Sonic screwdriver produces a way too loud sound. It's somewhat weird to use but works.
☑️ Vacuum cleaner works
I'll merge these changes in a week unless there are objections. This is a longer delay than what I usually do because it affects existing maps.
This solves a part of #601
The deprecated metadata gets converted to a proper ItemStackMetaRef.
All keys stay the same except for:
can_level
now, since they didn't store a serialized table in the metadata before.charge
which is nowtechnic:charge
, since any item (also from other mods) may have a technic charge which can cause compatibility problems.(For other keys e.g.
mode
, the key is special to the item and not universally used, which is not that problematic, I guess.)There is now only one place left where metadata is used, the sorting function of techinc chests:
technic/technic_chests/register.lua
Lines 149 to 150 in 5826c2f
However, I'm unsure how this should be changed.
Getting the whole stack meta as a table and use the amount of keys or a serialized version to sort, may be an option, but I don't think it is justified performance-wise.
To do
This PR is a Ready for Review.
(Maybe change the techinc chests sorting function.)
How to test
I tested it, and didn't find any problem, but I'm not sure if I missed something.
Compatibility note
Other mods which directly accessed the item metadata of technic items will not work anymore.