mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-23 15:15:10 +00:00
Add node timer back in so fires burn out
This commit is contained in:
parent
8e8ccddb68
commit
df4ea94dbc
1 changed files with 9 additions and 6 deletions
|
@ -85,10 +85,6 @@ local fire_death_messages = {
|
|||
N("@1 died in a fire."),
|
||||
}
|
||||
|
||||
local fire_timer = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(3, 7))
|
||||
end
|
||||
|
||||
local spawn_fire = function(pos, age)
|
||||
minetest.set_node(pos, {name="mcl_fire:fire", param2 = age})
|
||||
minetest.check_single_for_falling({x=pos.x, y=pos.y+1, z=pos.z})
|
||||
|
@ -126,6 +122,14 @@ minetest.register_node("mcl_fire:fire", {
|
|||
end,
|
||||
drop = "",
|
||||
sounds = {},
|
||||
on_timer= function(pos)
|
||||
if not minetest.find_node_near(pos, 1, {"group:flammable"}) then
|
||||
minetest.remove_node(pos)
|
||||
return
|
||||
end
|
||||
-- Restart timer
|
||||
return true
|
||||
end,
|
||||
-- Turn into eternal fire on special blocks, light Nether portal (if possible), start burning timer
|
||||
on_construct = function(pos)
|
||||
local bpos = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
|
@ -139,8 +143,7 @@ minetest.register_node("mcl_fire:fire", {
|
|||
if minetest.get_modpath("mcl_portals") then
|
||||
mcl_portals.light_nether_portal(pos)
|
||||
end
|
||||
|
||||
fire_timer(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(30, 60))
|
||||
spawn_smoke(pos)
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
|
|
Loading…
Reference in a new issue