From 5dde594c1933e6704c8dde5aff237a5dc1fa74c9 Mon Sep 17 00:00:00 2001 From: MysticTempest Date: Thu, 2 Jun 2022 01:50:51 -0500 Subject: [PATCH] Item movement fixes: This PR fixes items at flowing_water edges not falling down holes. As well as fixing items not sliding on slippery nodes like ice. And, allows for movement starting at the source block of a flowing water node. While ensuring regular water_source blocks do not bug out. --- mods/ENTITIES/mcl_item_entity/init.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 5d86071eb..1e781ef27 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -78,7 +78,6 @@ local function enable_physics(object, luaentity, ignore_check) object:set_properties({ physical = true }) - object:set_velocity({x=0,y=0,z=0}) object:set_acceleration({x=0,y=-get_gravity(),z=0}) end end @@ -774,8 +773,8 @@ minetest.register_entity(":__builtin:item", { return end - -- Move item around on flowing liquids - if def and def.liquidtype == "flowing" then + -- Move item around on flowing liquids; add 'source' check to allow items to continue flowing a bit in the source block of flowing water. + if def and def.liquidtype == "flowing" or def.liquidtype == "source" then --[[ Get flowing direction (function call from flowlib), if there's a liquid. NOTE: According to Qwertymine, flowlib.quickflow is only reliable for liquids with a flowing distance of 7. @@ -808,7 +807,7 @@ minetest.register_entity(":__builtin:item", { local nn = minetest.get_node({x=p.x, y=p.y-0.5, z=p.z}).name local v = self.object:get_velocity() - if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable and v.y == 0 then + if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable and not minetest.registered_nodes[nn].groups.slippery and v.y == 0 then if self.physical_state then local own_stack = ItemStack(self.object:get_luaentity().itemstring) -- Merge with close entities of the same item