From e5a260b56304e5cd959c54879c87728a86df8ef7 Mon Sep 17 00:00:00 2001 From: Dehydrate6684 Date: Sun, 5 Nov 2023 14:10:58 +0800 Subject: [PATCH] Added vines and skulk vines to ladder group --- mods/ITEMS/mcl_core/nodes_climb.lua | 15 +++++++++++---- mods/ITEMS/mcl_sculk/init.lua | 18 ++++++++++++++++-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_core/nodes_climb.lua b/mods/ITEMS/mcl_core/nodes_climb.lua index 609dd3cb9..0de0e9abd 100644 --- a/mods/ITEMS/mcl_core/nodes_climb.lua +++ b/mods/ITEMS/mcl_core/nodes_climb.lua @@ -15,7 +15,7 @@ end --- ---@param pos mt.Vector The position of the ladder. ---@param event "place" | "destruct" The place or destruct event. -local function update_trapdoor(pos, event) +function mcl_core.update_trapdoor(pos, event) local top_pos = vector.offset(pos, 0, 1, 0) local top_node = minetest.get_node_or_nil(top_pos) @@ -115,10 +115,10 @@ minetest.register_node("mcl_core:ladder", { return itemstack end, after_destruct = function(pos, old) - update_trapdoor(pos, "destruct") + mcl_core.update_trapdoor(pos, "destruct") end, after_place_node = function(pos) - update_trapdoor(pos, "place") + mcl_core.update_trapdoor(pos, "place") end, _mcl_blast_resistance = 0.4, _mcl_hardness = 0.4, @@ -158,7 +158,8 @@ minetest.register_node("mcl_core:vine", { flammable = 2, fire_encouragement = 15, fire_flammability = 100, - foliage_palette_wallmounted = 1 + foliage_palette_wallmounted = 1, + ladder = 1 }, sounds = mcl_sounds.node_sound_leaves_defaults(), drop = "", @@ -230,6 +231,12 @@ minetest.register_node("mcl_core:vine", { minetest.registered_nodes[node.name].on_dig(below, node, digger) end end, + after_destruct = function(pos, old) + mcl_core.update_trapdoor(pos, "destruct") + end, + after_place_node = function(pos) + mcl_core.update_trapdoor(pos, "place") + end, _mcl_blast_resistance = 0.2, diff --git a/mods/ITEMS/mcl_sculk/init.lua b/mods/ITEMS/mcl_sculk/init.lua index b2ef04152..4af60178e 100644 --- a/mods/ITEMS/mcl_sculk/init.lua +++ b/mods/ITEMS/mcl_sculk/init.lua @@ -215,9 +215,23 @@ minetest.register_node("mcl_sculk:vein", { type = "wallmounted", }, groups = { - handy = 1, axey = 1, shearsy = 1, swordy = 1, deco_block = 1, - dig_by_piston = 1, destroy_by_lava_flow = 1, sculk = 1, dig_by_water = 1, + handy = 1, + axey = 1, + shearsy = 1, + swordy = 1, + deco_block = 1, + dig_by_piston = 1, + destroy_by_lava_flow = 1, + sculk = 1, + dig_by_water = 1, + ladder = 1 }, + after_destruct = function(pos, old) + mcl_core.update_trapdoor(pos, "destruct") + end, + after_place_node = function(pos) + mcl_core.update_trapdoor(pos, "place") + end, sounds = sounds, drop = "", _mcl_shears_drop = true,