diff --git a/mods/CORE/mcl_enchanting/enchantments.lua b/mods/CORE/mcl_enchanting/enchantments.lua index 1da48f795..7ef5f7fe9 100644 --- a/mods/CORE/mcl_enchanting/enchantments.lua +++ b/mods/CORE/mcl_enchanting/enchantments.lua @@ -455,7 +455,7 @@ mcl_enchanting.enchantments.smite = { requires_tool = false, } --- unimplemented +-- implemented in mcl_playerplus mcl_enchanting.enchantments.soul_speed = { name = "Soul Speed", max_level = 3, diff --git a/mods/PLAYER/mcl_playerplus/depends.txt b/mods/PLAYER/mcl_playerplus/depends.txt index 6bbe4cbdb..7a259f8c1 100644 --- a/mods/PLAYER/mcl_playerplus/depends.txt +++ b/mods/PLAYER/mcl_playerplus/depends.txt @@ -7,3 +7,4 @@ playerphysics mcl_playerinfo mcl_weather mcl_spawn +mcl_enchanting diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 74d87c6c9..f18e6adfc 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -106,15 +106,21 @@ minetest.register_globalstep(function(dtime) -- set defaults def.speed = 1 - -- Standing on soul sand? If so, walk slower + -- Standing on soul sand? If so, walk slower (unless player wears Soul Speed boots) if node_stand == "mcl_nether:soul_sand" then -- TODO: Tweak walk speed -- TODO: Also slow down mobs -- Slow down even more when soul sand is above certain block - if node_stand_below == "mcl_core:ice" or node_stand_below == "mcl_core:packed_ice" or node_stand_below == "mcl_core:slimeblock" or node_stand_below == "mcl_core:water_source" then - playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:surface", 0.1) + local boots = player:get_inventory():get_stack("armor", 5) + local soul_speed = mcl_enchanting.get_enchantment(boots, "soul_speed") + if soul_speed > 0 then + playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:surface", soul_speed * 0.105 + 1.3) else - playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:surface", 0.4) + if node_stand_below == "mcl_core:ice" or node_stand_below == "mcl_core:packed_ice" or node_stand_below == "mcl_core:slimeblock" or node_stand_below == "mcl_core:water_source" then + playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:surface", 0.1) + else + playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:surface", 0.4) + end end else -- Reset speed decrease