minetest-mods / drawers

[MTG/MCL2] A Minetest Mod adding storage drawers in different sizes and wood types.
Other
19 stars 26 forks source link

addition request: refuse to accept items with metadata #87

Closed SwissalpS closed 9 months ago

SwissalpS commented 10 months ago

The way drawers store the contents doesn't allow for items to have metadata. Mostly these items aren't stackable so the check of max_stack weeds out a lot of incompatible items.

However, there are items that drawers currently accept and then return 'corrupted'.

One example are items created by the wrench:wrench (previously part of technic.plus). It saves the inventory and other node data in .meta.data and .meta.compressed of an item which normally can be stacked and can be used with drawers.

reference: https://github.com/mt-mods/wrench/tree/cc93ad0b541c3fb98c84016d9167424ff7e0aae1

adding a check for existing .metadata, .meta.compressed and .meta.data could do the trick --> not accept items with any non-empty mentioned fields

SwissalpS commented 10 months ago

most relevant part of wrench code: https://github.com/mt-mods/wrench/blob/cc93ad0b541c3fb98c84016d9167424ff7e0aae1/functions.lua#L62-L88