From 6f22d7daa477d6f82e8737270f1568e5f485995b Mon Sep 17 00:00:00 2001 From: SmokeyDope Date: Tue, 24 Jan 2023 17:15:22 +0000 Subject: [PATCH] Add node breaking logic to twisting vines and weeping vines breaking twisting vines will break the ones above them, breaking weeping vines breaks the ones below them --- mods/ITEMS/mcl_crimson/init.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mods/ITEMS/mcl_crimson/init.lua b/mods/ITEMS/mcl_crimson/init.lua index e1689b096..6d5d1e9ec 100644 --- a/mods/ITEMS/mcl_crimson/init.lua +++ b/mods/ITEMS/mcl_crimson/init.lua @@ -149,6 +149,16 @@ minetest.register_node("mcl_crimson:twisting_vines", { end return itemstack end, +--breaking twisting vines breaks the vines above logic + on_dig = function(pos, node, digger) + local above = {x=pos.x, y=pos.y+1, z=pos.z} + local abovenode = minetest.get_node(above) + minetest.node_dig(pos, node, digger) + if abovenode.name == node.name and (not mcl_core.check_vines_supported(above, abovenode)) then + minetest.registered_nodes[node.name].on_dig(above, node, digger) + end + end, + drop = { max_items = 1, items = { @@ -216,6 +226,17 @@ minetest.register_node("mcl_crimson:weeping_vines", { end return itemstack end, +--breaking weeping vines breaks the vines below logic + on_dig = function(pos, node, digger) + local below = {x=pos.x, y=pos.y-1, z=pos.z} + local belownode = minetest.get_node(below) + minetest.node_dig(pos, node, digger) + if belownode.name == node.name and (not mcl_core.check_vines_supported(below, belownode)) then + minetest.registered_nodes[node.name].on_dig(below, node, digger) + end + end, + + drop = { max_items = 1, items = {