From 80c492fd23b3ac930d0786bd55c4e7e475fb26ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Fri, 1 May 2020 18:22:02 +0200 Subject: Make elevators less deadly, add farming_undo support --- crafts.lua | 2 +- init.lua | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crafts.lua b/crafts.lua index 06cfa6e..09c75c9 100644 --- a/crafts.lua +++ b/crafts.lua @@ -56,7 +56,7 @@ elseif technic_path and chains_path then {"chains:chain", "default:diamond", "chains:chain"} }, }) -elseif technic_path and farming and farming.mod and farming.mod == "redo" then +elseif technic_path and farming and farming.mod and ( farming.mod == "redo" or farming.mod == "undo" ) then -- add alternative recipe with hemp rope minetest.register_craft({ output = "elevator:elevator", diff --git a/init.lua b/init.lua index 89e9b02..eee4d8a 100644 --- a/init.lua +++ b/init.lua @@ -314,6 +314,10 @@ local box_entity = { for y=self.lastpos.y,pos.y,((self.lastpos.y > pos.y) and -0.3 or 0.3) do local p = vector.round({x=pos.x, y=y, z=pos.z}) local node = get_node(p) + if vector.distance(p,self.target) < elevator.SLOW_DIST then + self.object:set_velocity({x=0, y=elevator.SLOW_SPEED*self.vmult, z=0}) + end + if node.name == "elevator:shaft" then -- Nothing, just continue on our way. elseif node.name == "elevator:elevator_on" or node.name == "elevator:elevator_off" then -- cgit v1.2.3