From 16c1181a47a91c96b4be01971fcc143e588bc60f Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 21 Aug 2017 16:37:21 +0200 Subject: [PATCH] Destroy fire by flooding --- mods/ITEMS/mcl_fire/init.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index 45eb449723..f35dbfa4dd 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -36,6 +36,12 @@ minetest.register_node("mcl_fire:fire", { sunlight_propagates = true, damage_per_second = 1, groups = {fire = 1, dig_immediate = 3, not_in_creative_inventory = 1, dig_by_piston=1}, + floodable = true, + on_flood = function(pos, oldnode, newnode) + if minetest.get_item_group(newnode.name, "water") ~= 0 then + minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}) + end + end, on_timer = function(pos) local airs = minetest.find_nodes_in_area({x=pos.x-1, y=pos.y-1, z=pos.z-1}, {x=pos.x+1, y=pos.y+4, z=pos.z+1}, {"air"}) if #airs == 0 then @@ -100,6 +106,12 @@ minetest.register_node("mcl_fire:eternal_fire", { sunlight_propagates = true, damage_per_second = 1, groups = {fire = 1, dig_immediate = 3, not_in_creative_inventory = 1, dig_by_piston = 1}, + floodable = true, + on_flood = function(pos, oldnode, newnode) + if minetest.get_item_group(newnode.name, "water") ~= 0 then + minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}) + end + end, on_timer = function(pos) local airs = minetest.find_nodes_in_area({x=pos.x-1, y=pos.y-1, z=pos.z-1}, {x=pos.x+1, y=pos.y+4, z=pos.z+1}, {"air"}) while #airs > 0 do