Closed cx384 closed 5 months ago
This solves a part of #601
The deprecated metadata gets converted to a proper ItemStackMetaRef. All keys stay the same except for:
can_level
charge
technic:charge
(For other keys e.g. mode, the key is special to the item and not universally used, which is not that problematic, I guess.)
mode
There is now only one place left where metadata is used, the sorting function of techinc chests: https://github.com/minetest-mods/technic/blob/5826c2feaa5aea2ade07af93cfec05952470c17b/technic_chests/register.lua#L149-L150 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.
This PR is a Ready for Review.
(Maybe change the techinc chests sorting function.)
I tested it, and didn't find any problem, but I'm not sure if I missed something.
Other mods which directly accessed the item metadata of technic items will not work anymore.
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: https://github.com/minetest-mods/technic/blob/5826c2feaa5aea2ade07af93cfec05952470c17b/technic_chests/register.lua#L149-L150 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.