Use "register_lbm" with "run_at_every_load" instead of...
..."register_abm" to save resources. Suggested by bell07: https://forum.minetest.net/viewtopic.php?p=325519#p325519
This commit is contained in:
parent
6b50d1c52a
commit
2c127af4af
1
TODO.txt
1
TODO.txt
@ -1,3 +1,2 @@
|
||||
|
||||
TODO:
|
||||
- use register_lbm with run_at_every_load instead of register_abm ( https://forum.minetest.net/viewtopic.php?p=325519#p325519 )
|
||||
|
@ -1,4 +1,9 @@
|
||||
|
||||
v1.1
|
||||
----
|
||||
- uses "register_lbm" with "run_at_every_load" instead of "register_abm" to save resources
|
||||
- suggested by bell07 ( https://forum.minetest.net/viewtopic.php?p=325519#p325519 )
|
||||
|
||||
v1.0
|
||||
----
|
||||
- changed license to MIT
|
||||
|
12
nodes.lua
12
nodes.lua
@ -56,10 +56,10 @@ for _, n in ipairs(n_list.remove) do
|
||||
})
|
||||
end
|
||||
|
||||
core.register_abm({
|
||||
core.register_lbm({
|
||||
name = "cleaner:remove_nodes",
|
||||
nodenames = {"group:to_remove"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
run_at_every_load = true,
|
||||
action = function(pos, node)
|
||||
core.remove_node(pos)
|
||||
end,
|
||||
@ -73,10 +73,10 @@ for n_old, n_new in pairs(n_list.replace) do
|
||||
})
|
||||
end
|
||||
|
||||
core.register_abm({
|
||||
core.register_lbm({
|
||||
name = "cleaner:replace_nodes",
|
||||
nodenames = {"group:to_replace"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
run_at_every_load = true,
|
||||
action = function(pos, node)
|
||||
core.remove_node(pos)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user