From 0bb79f05c4a53c0d3d9e227494e24d1b9ed8c566 Mon Sep 17 00:00:00 2001 From: seventeenthShulker Date: Sun, 18 Aug 2024 18:59:57 +0200 Subject: [PATCH] Soul speed works on soul soil too (needs localization) --- mods/ITEMS/mcl_enchanting/enchantments.lua | 2 +- mods/PLAYER/mcl_playerplus/init.lua | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/mods/ITEMS/mcl_enchanting/enchantments.lua b/mods/ITEMS/mcl_enchanting/enchantments.lua index 44b3a5bd6..64fe2ac09 100644 --- a/mods/ITEMS/mcl_enchanting/enchantments.lua +++ b/mods/ITEMS/mcl_enchanting/enchantments.lua @@ -691,7 +691,7 @@ mcl_enchanting.enchantments.soul_speed = { disallow = {non_combat_armor = true}, incompatible = {frost_walker = true}, weight = 2, - description = S("Increases walking speed on soul sand."), + description = S("Increases walking speed on soul sand and soul soil."), curse = false, on_enchant = function() end, requires_tool = false, diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 709d1d0fb..6c4e537d5 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -514,13 +514,18 @@ minetest.register_globalstep(function(dtime) return end - -- Standing on soul sand? If so, walk slower (unless player wears Soul Speed boots) - if node_stand == "mcl_nether:soul_sand" then + local boots = player:get_inventory():get_stack("armor", 5) + local soul_speed = mcl_enchanting.get_enchantment(boots, "soul_speed") + + -- Standing on soul soil? If so, apply Soul Speed bonus + if node_stand == "mcl_blackstone:soul_soil" and soul_speed > 0 then + playerphysics.add_physics_factor(player, "speed", "mcl_playerplus:soul_speed", soul_speed * 0.105 + 1.3) + + -- Standing on soul sand? If so, walk slower (unless player wears Soul Speed boots, then apply bonus) + elseif 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 - 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:soul_speed", soul_speed * 0.105 + 1.3) else