diff --git a/mods/PLAYER/mcl_hunger/init.lua b/mods/PLAYER/mcl_hunger/init.lua index 09ef117d5..349e82577 100644 --- a/mods/PLAYER/mcl_hunger/init.lua +++ b/mods/PLAYER/mcl_hunger/init.lua @@ -16,7 +16,7 @@ mcl_hunger.EXHAUST_DIG = 5 -- after digging node mcl_hunger.EXHAUST_JUMP = 50 -- jump mcl_hunger.EXHAUST_SPRINT_JUMP = 200 -- TODO: jump while sprinting mcl_hunger.EXHAUST_ATTACK = 100 -- hit an enemy -mcl_hunger.EXHAUST_SWIM = 10 -- TODO: player movement in water +mcl_hunger.EXHAUST_SWIM = 10 -- player movement in water mcl_hunger.EXHAUST_SPRINT = 100 -- sprint (per node) mcl_hunger.EXHAUST_DAMAGE = 100 -- TODO (mostly done): taking damage (protected by armor) mcl_hunger.EXHAUST_REGEN = 6000 -- Regenerate 1 HP diff --git a/mods/PLAYER/playerplus/init.lua b/mods/PLAYER/playerplus/init.lua index 064a5529c..3300e173c 100644 --- a/mods/PLAYER/playerplus/init.lua +++ b/mods/PLAYER/playerplus/init.lua @@ -143,9 +143,8 @@ minetest.register_globalstep(function(dtime) end end - -- Underwater: Spawn bubble particles, cause exhaustion - - if minetest.get_item_group(playerplus[name].nod_head, "water") ~= 0 then + -- Swimming: Cause exhaustion + if minetest.get_item_group(playerplus[name].nod_head, "liquid") ~= 0 or minetest.get_item_group(playerplus[name].nod_feet, "liquid") ~= 0 or minetest.get_item_group(playerplus[name].nod_stand, "liquid") ~= 0 then local lastPos = playerplus_internal[name].lastPos if lastPos then local dist = vector.distance(lastPos, pos) @@ -156,6 +155,10 @@ minetest.register_globalstep(function(dtime) playerplus_internal[name].swimDistance = playerplus_internal[name].swimDistance - superficial end end + end + + -- Underwater: Spawn bubble particles + if minetest.get_item_group(playerplus[name].nod_head, "water") ~= 0 then minetest.add_particlespawner({ amount = 10,