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