mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-12 02:50:25 +01:00
forgot the default/fire update/merge
simplement un changement de fonctions utilisé
This commit is contained in:
parent
c1043f0120
commit
35a13c8faf
@ -11,7 +11,7 @@ minetest.register_node("fire:basic_flame", {
|
|||||||
}},
|
}},
|
||||||
inventory_image = "fire_basic_flame.png",
|
inventory_image = "fire_basic_flame.png",
|
||||||
light_source = 14,
|
light_source = 14,
|
||||||
groups = {igniter=2,dig_immediate=3},
|
groups = {igniter=2,dig_immediate=3,hot=3},
|
||||||
drop = '',
|
drop = '',
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
@ -26,6 +26,7 @@ minetest.register_node("fire:basic_flame", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
fire = {}
|
||||||
fire.D = 6
|
fire.D = 6
|
||||||
-- key: position hash of low corner of area
|
-- key: position hash of low corner of area
|
||||||
-- value: {handle=sound handle, name=sound name}
|
-- value: {handle=sound handle, name=sound name}
|
||||||
@ -82,10 +83,12 @@ function fire.update_sounds_around(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function fire.on_flame_add_at(pos)
|
function fire.on_flame_add_at(pos)
|
||||||
|
--print("flame added at "..minetest.pos_to_string(pos))
|
||||||
fire.update_sounds_around(pos)
|
fire.update_sounds_around(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
function fire.on_flame_remove_at(pos)
|
function fire.on_flame_remove_at(pos)
|
||||||
|
--print("flame removed at "..minetest.pos_to_string(pos))
|
||||||
fire.update_sounds_around(pos)
|
fire.update_sounds_around(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -116,6 +119,7 @@ minetest.register_abm({
|
|||||||
local p = fire.find_pos_for_flame_around(p0)
|
local p = fire.find_pos_for_flame_around(p0)
|
||||||
if p then
|
if p then
|
||||||
minetest.set_node(p, {name="fire:basic_flame"})
|
minetest.set_node(p, {name="fire:basic_flame"})
|
||||||
|
fire.on_flame_add_at(p)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
@ -141,6 +145,7 @@ minetest.register_abm({
|
|||||||
local p2 = fire.find_pos_for_flame_around(p)
|
local p2 = fire.find_pos_for_flame_around(p)
|
||||||
if p2 then
|
if p2 then
|
||||||
minetest.set_node(p2, {name="fire:basic_flame"})
|
minetest.set_node(p2, {name="fire:basic_flame"})
|
||||||
|
fire.on_flame_add_at(p2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
@ -155,6 +160,7 @@ minetest.register_abm({
|
|||||||
-- If there is water or stuff like that around flame, remove flame
|
-- If there is water or stuff like that around flame, remove flame
|
||||||
if fire.flame_should_extinguish(p0) then
|
if fire.flame_should_extinguish(p0) then
|
||||||
minetest.remove_node(p0)
|
minetest.remove_node(p0)
|
||||||
|
fire.on_flame_remove_at(p0)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Make the following things rarer
|
-- Make the following things rarer
|
||||||
@ -164,6 +170,7 @@ minetest.register_abm({
|
|||||||
-- If there are no flammable nodes around flame, remove flame
|
-- If there are no flammable nodes around flame, remove flame
|
||||||
if not minetest.find_node_near(p0, 1, {"group:flammable"}) then
|
if not minetest.find_node_near(p0, 1, {"group:flammable"}) then
|
||||||
minetest.remove_node(p0)
|
minetest.remove_node(p0)
|
||||||
|
fire.on_flame_remove_at(p0)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if math.random(1,4) == 1 then
|
if math.random(1,4) == 1 then
|
||||||
@ -180,6 +187,7 @@ minetest.register_abm({
|
|||||||
else
|
else
|
||||||
-- remove flame
|
-- remove flame
|
||||||
minetest.remove_node(p0)
|
minetest.remove_node(p0)
|
||||||
|
fire.on_flame_remove_at(p0)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user