From 1558c852d8e5b95c070fcd79628734df6c815172 Mon Sep 17 00:00:00 2001 From: Michieal Date: Wed, 8 Feb 2023 23:03:17 -0500 Subject: [PATCH] Undo mesecon.register_mvps_dropper() and use abms until more research can be done. --- mods/ITEMS/mcl_bamboo/globals.lua | 1 + mods/ITEMS/mcl_bamboo/init.lua | 36 +++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/mods/ITEMS/mcl_bamboo/globals.lua b/mods/ITEMS/mcl_bamboo/globals.lua index 54c1c85ee..8cde95aa0 100644 --- a/mods/ITEMS/mcl_bamboo/globals.lua +++ b/mods/ITEMS/mcl_bamboo/globals.lua @@ -69,6 +69,7 @@ local BAMBOO_ENDCAP_NAME = "mcl_bamboo:bamboo_endcap" -- For when I learn more about the pistons... function mcl_bamboo.break_orphaned(pos) + mcl_bamboo.mcl_log("Break_Orphaned called.") local node_below = minetest.get_node(vector.offset(pos, 0, -1, 0)) local node_name = node_below.name diff --git a/mods/ITEMS/mcl_bamboo/init.lua b/mods/ITEMS/mcl_bamboo/init.lua index 89a2f5d8a..f2323b66c 100644 --- a/mods/ITEMS/mcl_bamboo/init.lua +++ b/mods/ITEMS/mcl_bamboo/init.lua @@ -35,23 +35,37 @@ minetest.register_abm({ end, }) +--[[ TODO: Figure out how to make this work: +local function dropper_call(node, pushdir, stack, stackid) + mcl_bamboo.mcl_log("mvps_dropper call for bamboo:") + -- mcl_bamboo.break_orphaned() + + mcl_bamboo.mcl_log(dump(node)) + +end + if minetest.get_modpath("mesecons_mvps") then - if mesecons_mvps then + if mesecon then + mcl_bamboo.mcl_log("registering mvps_dropper for bamboo:") for x = 1, #mcl_bamboo.bamboo_index do - mesecon.register_mvps_dropper(mcl_bamboo.bamboo_index[x], mcl_bamboo.break_orphaned) + mesecon.register_mvps_dropper(mcl_bamboo.bamboo_index[x],dropper_call) + mcl_bamboo.mcl_log("registering: " .. mcl_bamboo.bamboo_index[x]) end end else - minetest.register_abm({ - label = "Break Orphaned Bamboo", - nodenames = mcl_bamboo.bamboo_index, - interval = 1.5, - chance = 1, - action = function(pos, _) - mcl_bamboo.break_orphaned(pos) - end, - }) end +--]] + +minetest.register_abm({ + label = "Break Orphaned Bamboo", + nodenames = mcl_bamboo.bamboo_index, + interval = 1.5, + chance = 1, + action = function(pos, _) + mcl_bamboo.break_orphaned(pos) + end, +}) + -- Base Aliases. local SCAFFOLDING_NAME = "mcl_bamboo:scaffolding"