From 83007aaba09f3342b5d326a5016647226209c615 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Mon, 13 Jan 2025 14:36:24 +0000 Subject: [PATCH 1/2] Update mod.conf add pova optional dependency. --- mod.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod.conf b/mod.conf index 43bd36e..d920e84 100644 --- a/mod.conf +++ b/mod.conf @@ -3,4 +3,4 @@ title = Stamina description = Adds stamina and hunger effects. min_minetest_version = 5.4 depends = default -optional_depends = 3d_armor, player_monoids +optional_depends = 3d_armor, player_monoids, pova From 874f992f36dea38341333d4bbebb1151965e4aef Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Mon, 13 Jan 2025 14:38:05 +0000 Subject: [PATCH 2/2] Update init.lua add pova support --- init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/init.lua b/init.lua index 54f4f24..4c642f9 100644 --- a/init.lua +++ b/init.lua @@ -7,6 +7,7 @@ stamina = {} local modname = minetest.get_current_modname() local armor_mod = minetest.get_modpath("3d_armor") and minetest.global_exists("armor") and armor.def local player_monoids_mod = minetest.get_modpath("player_monoids") and minetest.global_exists("player_monoids") +local pova_mod = minetest.get_modpath("pova") and minetest.global_exists("pova") function stamina.log(level, message, ...) return minetest.log(level, ("[%s] %s"):format(modname, message:format(...))) @@ -264,6 +265,15 @@ function stamina.set_sprinting(player, sprinting) player_monoids.speed:del_change(player, "stamina:physics") player_monoids.jump:del_change(player, "stamina:physics") end + elseif pova_mod then + if sprinting then + pova.add_override(player:get_player_name(), "stamina:physics", + {speed = settings.sprint_speed, jump = settings.sprint_jump}) + pova.do_override(player) + else + pova.del_override(player:get_player_name(), "stamina:physics") + pova.do_override(player) + end else local def if armor_mod then