diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index e12f73fc0f..94dda9cf91 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -197,6 +197,18 @@ minetest.register_globalstep(function(dtime) playerphysics.remove_physics_factor(player, "speed", "mcl_playerplus:surface") end + -- Swimming? Check if boots are enchanted with depth strider + if node_feet == "mcl_core:water_source" or node_feet == "mclx_core:river_water_source" then + local boots = player:get_inventory():get_stack("armor", 5) + local depth_strider = mcl_enchanting.get_enchantment(boots, "depth_strider") + + if depth_strider > 0 then + playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:surface", depth_strider / 2) + end + else + playerphysics.remove_physics_factor(player, "speed", "mcl_playerplus:surface") + end + -- Is player suffocating inside node? (Only for solid full opaque cube type nodes -- without group disable_suffocation=1) local ndef = minetest.registered_nodes[node_head]