diff --git a/mods/ITEMS/mcl_enchanting/enchantments.lua b/mods/ITEMS/mcl_enchanting/enchantments.lua index 7056ba13..893ce58d 100644 --- a/mods/ITEMS/mcl_enchanting/enchantments.lua +++ b/mods/ITEMS/mcl_enchanting/enchantments.lua @@ -124,8 +124,8 @@ mcl_enchanting.enchantments.curse_of_vanishing = { inv_tool_tab = true, } --- unimplemented ---[[mcl_enchanting.enchantments.depth_strider = { +-- implemented in mcl_playerplus +mcl_enchanting.enchantments.depth_strider = { name = S("Depth Strider"), max_level = 3, primary = {}, @@ -141,7 +141,7 @@ mcl_enchanting.enchantments.curse_of_vanishing = { power_range_table = {{10, 25}, {20, 35}, {30, 45}}, inv_combat_tab = true, inv_tool_tab = false, -}]]-- +} -- implemented via on_enchant mcl_enchanting.enchantments.efficiency = { diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index e12f73fc..73e799a3 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 minetest.get_item_group(node_feet, "liquid") ~= 0 and mcl_enchanting.get_enchantment(player:get_inventory():get_stack("armor", 5), "depth_strider") 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 / 3) + 0.75) + 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]