From 92c5b8d7d2ae39d6a4a666587d89874d75494d83 Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 26 Dec 2024 19:46:10 +0100 Subject: [PATCH] Add dripstone selection boxes --- mods/ITEMS/mcl_dripstone/init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mods/ITEMS/mcl_dripstone/init.lua b/mods/ITEMS/mcl_dripstone/init.lua index b7aba45b5..a77224dd5 100644 --- a/mods/ITEMS/mcl_dripstone/init.lua +++ b/mods/ITEMS/mcl_dripstone/init.lua @@ -217,6 +217,16 @@ minetest.register_craftitem("mcl_dripstone:pointed_dripstone", { for i = 1, #dripstone_stages do local stage = dripstone_stages[i] + local add = ( i - 1 ) / 16 + local box_top = { + type = "fixed", + fixed = { math.max(-0.5, -3/16 - add), -0.5, math.max(-0.5, -3/16 - add), math.min(0.5, 3/16 + add), 0.5, math.min(3/16 + add) }, + } + local box_bottom = { + type = "fixed", + fixed = { math.max(-0.5, -3/16 - add), -0.5, math.max(-0.5, -3/16 - add), math.min(0.5, 3/16 + add), 0.5, math.min(0.5, 3/16 + add) }, + } + minetest.register_node("mcl_dripstone:dripstone_top_" .. stage, { description = S("Pointed dripstone (@1/@2)", i, #dripstone_stages), _doc_items_longdesc = S("Pointed dripstone is what stalagmites and stalagtites are made of"), @@ -228,6 +238,8 @@ for i = 1, #dripstone_stages do sunlight_propagates = true, paramtype = "light", is_ground_content = false, + selection_box = box_top, + collision_box = box_top, sounds = mcl_sounds.node_sound_stone_defaults(), on_destruct = on_dripstone_destruct, _mcl_blast_resistance = 3, @@ -245,6 +257,8 @@ for i = 1, #dripstone_stages do sunlight_propagates = true, paramtype = "light", is_ground_content = false, + selection_box = box_bottom, + collision_box = box_bottom, sounds = mcl_sounds.node_sound_stone_defaults(), on_destruct = on_dripstone_destruct, _mcl_blast_resistance = 3,