forked from MineClone5/MineClone5
Destroy fire by flooding
This commit is contained in:
parent
1189b8d299
commit
16c1181a47
|
@ -36,6 +36,12 @@ minetest.register_node("mcl_fire:fire", {
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
damage_per_second = 1,
|
damage_per_second = 1,
|
||||||
groups = {fire = 1, dig_immediate = 3, not_in_creative_inventory = 1, dig_by_piston=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)
|
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"})
|
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
|
if #airs == 0 then
|
||||||
|
@ -100,6 +106,12 @@ minetest.register_node("mcl_fire:eternal_fire", {
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
damage_per_second = 1,
|
damage_per_second = 1,
|
||||||
groups = {fire = 1, dig_immediate = 3, not_in_creative_inventory = 1, dig_by_piston = 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)
|
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"})
|
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
|
while #airs > 0 do
|
||||||
|
|
Loading…
Reference in New Issue