forked from VoxeLibre/VoxeLibre
Add node timer back in so fires burn out
This commit is contained in:
parent
8e8ccddb68
commit
df4ea94dbc
|
@ -85,10 +85,6 @@ local fire_death_messages = {
|
||||||
N("@1 died in a fire."),
|
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)
|
local spawn_fire = function(pos, age)
|
||||||
minetest.set_node(pos, {name="mcl_fire:fire", param2 = 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})
|
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,
|
end,
|
||||||
drop = "",
|
drop = "",
|
||||||
sounds = {},
|
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
|
-- Turn into eternal fire on special blocks, light Nether portal (if possible), start burning timer
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local bpos = {x=pos.x, y=pos.y-1, z=pos.z}
|
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
|
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))
|
||||||
fire_timer(pos)
|
|
||||||
spawn_smoke(pos)
|
spawn_smoke(pos)
|
||||||
end,
|
end,
|
||||||
on_destruct = function(pos)
|
on_destruct = function(pos)
|
||||||
|
|
Loading…
Reference in New Issue