minetest-mods / stamina

Adds hunger (stamina) to minetest.
17 stars 18 forks source link

use new player metadata API when available #29

Closed fluxionary closed 4 years ago

fluxionary commented 4 years ago

The old player metadata API is deprecated, so I've written some code to use the new API if it is available, but fall back to the old API if it is not.

SmallJoker commented 4 years ago

Why is the player meta used, rather than simple tables? Meta is persistent, but HUD IDs and tables aren't.

fluxionary commented 4 years ago

Why is the player meta used, rather than simple tables? Meta is persistent, but HUD IDs and tables aren't.

For the HUD ID? You'd have to ask whoever wrote the mod originally; I kept what they did intact, but I didn't understand why that was the way it was. If you prefer, I can store the HUD IDs in a table.

fluxionary commented 4 years ago

Made the change so that HUD IDs are no longer stored in metadata. I also noticed that the way that poisoning is done is kind of stupid, but I'll save that for another PR.