forked from Mineclonia/Mineclonia
make nodes actually be removed by the fire
This commit is contained in:
parent
5d46e8ebd2
commit
3e5f0f75d9
|
@ -90,6 +90,10 @@ local spawn_fire = function(pos, age)
|
||||||
minetest.check_single_for_falling({x=pos.x, y=pos.y+1, z=pos.z})
|
minetest.check_single_for_falling({x=pos.x, y=pos.y+1, z=pos.z})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function fire_timer(pos)
|
||||||
|
return minetest.get_node_timer(pos):start(math.random(30, 60))
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_node("mcl_fire:fire", {
|
minetest.register_node("mcl_fire:fire", {
|
||||||
description = S("Fire"),
|
description = S("Fire"),
|
||||||
_doc_items_longdesc = fire_help,
|
_doc_items_longdesc = fire_help,
|
||||||
|
@ -143,8 +147,8 @@ minetest.register_node("mcl_fire:fire", {
|
||||||
if minetest.get_modpath("mcl_portals") then
|
if minetest.get_modpath("mcl_portals") then
|
||||||
mcl_portals.light_nether_portal(pos)
|
mcl_portals.light_nether_portal(pos)
|
||||||
end
|
end
|
||||||
minetest.get_node_timer(pos):start(math.random(30, 60))
|
|
||||||
spawn_smoke(pos)
|
spawn_smoke(pos)
|
||||||
|
fire_timer(pos)
|
||||||
end,
|
end,
|
||||||
on_destruct = function(pos)
|
on_destruct = function(pos)
|
||||||
mcl_particles.delete_node_particlespawners(pos)
|
mcl_particles.delete_node_particlespawners(pos)
|
||||||
|
@ -457,8 +461,8 @@ else -- Fire enabled
|
||||||
-- Remove flammable nodes around basic flame
|
-- Remove flammable nodes around basic flame
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
label = "Remove flammable nodes",
|
label = "Remove flammable nodes",
|
||||||
nodenames = {"mc_fire:fire"},
|
nodenames = {"mcl_fire:fire","mcl_fire:eternal_fire"},
|
||||||
neighbors = "group:flammable",
|
neighbors = {"group:flammable"},
|
||||||
interval = 5,
|
interval = 5,
|
||||||
chance = 18,
|
chance = 18,
|
||||||
catch_up = false,
|
catch_up = false,
|
||||||
|
@ -472,7 +476,8 @@ else -- Fire enabled
|
||||||
if def.on_burn then
|
if def.on_burn then
|
||||||
def.on_burn(p)
|
def.on_burn(p)
|
||||||
else
|
else
|
||||||
minetest.remove_node(p)
|
minetest.swap_node(p, {name = "mcl_fire:fire"})
|
||||||
|
fire_timer(p)
|
||||||
minetest.check_for_falling(p)
|
minetest.check_for_falling(p)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue