From 80a45c2c0d36ff5e2ebe87906331a46838c5e7e9 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Fri, 12 Apr 2024 07:37:34 +0000 Subject: [PATCH] Give carts a small vertical lift when pushed to allow them to get back on rails --- mods/ENTITIES/mcl_minecarts/movement.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/ENTITIES/mcl_minecarts/movement.lua b/mods/ENTITIES/mcl_minecarts/movement.lua index 2f5acdf71..198a2fede 100644 --- a/mods/ENTITIES/mcl_minecarts/movement.lua +++ b/mods/ENTITIES/mcl_minecarts/movement.lua @@ -494,6 +494,11 @@ local function do_detached_movement(self, dtime) if away then local v = self.object:get_velocity() self.object:set_velocity(v - away) + + -- Boost the minecart vertically a bit to get over the edge of rails and things like carpets + local boost = vector.offset(vector.multiply(vector.normalize(away), 0.1), 0, 0.07, 0) -- 1/16th + 0.0075 + local pos = self.object:get_pos() + self.object:set_pos(vector.add(pos,boost)) end -- Try to reconnect to rail