Make fire actually remove nodes

master
cora 2022-01-14 23:50:36 +01:00 committed by Nils Dagsson Moskopp
parent df4ea94dbc
commit 4deca628dc
No known key found for this signature in database
GPG Key ID: A3BC671C35191080
1 changed files with 9 additions and 4 deletions

View File

@ -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