From 058049897c7bad7d301c35e423432d2f6d2fd389 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 22 Aug 2017 17:14:27 +0200 Subject: [PATCH] Drop sugar canes when dirt/etc. below was dug --- mods/ITEMS/mcl_core/functions.lua | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 48df96d01..a6f346d04 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -188,7 +188,7 @@ minetest.register_abm({ }) -- --- Papyrus and cactus drop +-- Sugar canes drop -- local timber_nodenames={"mcl_core:reeds"} @@ -196,15 +196,11 @@ local timber_nodenames={"mcl_core:reeds"} minetest.register_on_dignode(function(pos, node) local i=1 while timber_nodenames[i]~=nil do - if node.name==timber_nodenames[i] then - local np={x=pos.x, y=pos.y+1, z=pos.z} - while minetest.get_node(np).name==timber_nodenames[i] do - minetest.remove_node(np) - if not minetest.settings:get_bool("creative_mode") then - minetest.add_item(np, timber_nodenames[i]) - end - np={x=np.x, y=np.y+1, z=np.z} - end + local np={x=pos.x, y=pos.y+1, z=pos.z} + while minetest.get_node(np).name==timber_nodenames[i] do + minetest.remove_node(np) + minetest.add_item(np, timber_nodenames[i]) + np={x=np.x, y=np.y+1, z=np.z} end i=i+1 end