From 1f4f6a0e84f935e582d67af1045a26cf1d5c56c2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 20 Feb 2017 17:06:19 +0100 Subject: [PATCH] Soul sand + (packed) ice or slimeblock = ultraslow --- mods/PLAYER/playerplus/init.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mods/PLAYER/playerplus/init.lua b/mods/PLAYER/playerplus/init.lua index e3da18a43d..079d5b7229 100644 --- a/mods/PLAYER/playerplus/init.lua +++ b/mods/PLAYER/playerplus/init.lua @@ -51,6 +51,7 @@ minetest.register_globalstep(function(dtime) -- what is around me? pos.y = pos.y - 0.1 -- standing on playerplus[name].nod_stand = node_ok(pos) + playerplus[name].nod_stand_below = node_ok({x=pos.x, y=pos.y-1, z=pos.z}) pos.y = pos.y + 1.5 -- head level playerplus[name].nod_head = node_ok(pos) @@ -75,10 +76,14 @@ minetest.register_globalstep(function(dtime) -- standing on soul sand? if so walk slower if playerplus[name].nod_stand == "mcl_nether:soul_sand" then - -- TODO: Fix walk speed - -- TODO: Also check other blocks + -- TODO: Tweak walk speed -- TODO: Also slow down mobs - def.speed = def.speed - 0.6 + local below = playerplus[name].nod_stand_below + if below == "mcl_core:ice" or below == "mcl_core:packed_ice" or below == "mcl_core:slimeblock" then + def.speed = def.speed - 0.9 + else + def.speed = def.speed - 0.6 + end end -- set player physics