This post is more or less a converted copy of the README.md file.
Description
This server mod provides upgradeable packs in form of items to players which give them additional health or breath. However, the better the health packs are and the more of them you use, the faster they will wear out.
Please note that the builtin HP bar maximum is always 10 hearts. With two additional "+10 HP" packs, one heart equals 4 HP (instead of previously 2).
Features
Unified Inventory and sfinv support
Chat command fallback formspec when no inventory mod was detected
+ 10 HP pack (damages player on craft)
+ 5 breath pack (takes breath on craft)
Dependencies: default, vessels (minetest_game content) Optional dependencies: unified_inventory, sfinv Requires Minetest 5.0.0-dev and optionally #7360 to ensure that everything is displayed correctly License: MIT Links:GitHub Source (.git), Nasty *.zip
Hi, so I've found a rather big bug in your mod.
What I've noticed is that everytime a player leaves the game the server crashes if said player has any upgrade packs equipped. Minetest crashes with this error:
AsyncErr: ServerThread::run Lua: Runtime error from mod 'upgrade_packs' in callback on_leaveplayer(): ...minetest-5.2.0-win64\bin\..\builtin\common\serialize.lua:151: Can't serialize data of type userdata
stack traceback:
[C]: in function 'error'
...minetest-5.2.0-win64\bin\..\builtin\common\serialize.lua:151: in function 'dump_or_ref_val'
...minetest-5.2.0-win64\bin\..\builtin\common\serialize.lua:138: in function 'dump_or_ref_val'
...minetest-5.2.0-win64\bin\..\builtin\common\serialize.lua:166: in function 'serialize'
...t\minetest-5.2.0-win64\bin\..\mods\upgrade_packs/api.lua:29: in function <...t\minetest-5.2.0-win64\bin\..\mods\upgrade_packs/api.lua:24>
...nt\minetest-5.2.0-win64\bin\..\builtin\game\register.lua:429: in function <...nt\minetest-5.2.0-win64\bin\..\builtin\game\register.lua:413>
I've tested this with most 5.x versions already and it happens on all of them (including, but not limited to 5.2.0 and 5.1.1).
I would really appreciate if you could fix this bug as I would love to deploy this mod on my private server.
You cannot eat the hearts. They are items that you can put into the new upgrade slots of your inventory to increase the maximal health of your character. The heart count in the status bar will not change, but 1 HP no longer corresponds to 1/2 status bar heart.
You should find these upgrade slots in a separate tab (for Minetest Game's sfinv inventory) or as the button shown in the second part of the image (for Unified Inventory). Other inventory mods (such as inventory_plus and i3) are currently not supported.