From 4b61b3b4e5d9fdd321fa9a12c1c14aae11110659 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 17 Jan 2021 12:29:25 +0100 Subject: [PATCH] #986 --- mods/ITEMS/mcl_cauldrons/init.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_cauldrons/init.lua b/mods/ITEMS/mcl_cauldrons/init.lua index 7f0592b2..a82a0b53 100644 --- a/mods/ITEMS/mcl_cauldrons/init.lua +++ b/mods/ITEMS/mcl_cauldrons/init.lua @@ -82,7 +82,7 @@ local register_filled_cauldron = function(water_level, description, river_water) drawtype = "nodebox", paramtype = "light", is_ground_content = false, - groups = {pickaxey=1, not_in_creative_inventory=1, cauldron=(1+water_level), comparator_signal=water_level}, + groups = {pickaxey=1, not_in_creative_inventory=1, cauldron=(1+water_level), cauldron_filled=water_level, comparator_signal=water_level}, node_box = cauldron_nodeboxes[water_level], collision_box = cauldron_nodeboxes[0], selection_box = { type = "regular" }, @@ -122,3 +122,20 @@ minetest.register_craft({ { "mcl_core:iron_ingot", "mcl_core:iron_ingot", "mcl_core:iron_ingot" }, } }) + +minetest.register_abm({ + label = "cauldrons", + nodenames = {"group:cauldron_filled"}, + interval = 0.5, + chance = 1, + action = function(pos, node) + for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 0.4)) do + if mcl_burning.is_burning(obj) then + mcl_burning.extinguish(obj) + local new_group = minetest.get_item_group(node.name, "cauldron_filled") - 1 + minetest.swap_node(pos, {name = "mcl_cauldrons:cauldron" .. (new_group == 0 and "" or "_" .. new_group)}) + break + end + end + end +})