mirror of
https://github.com/minetest/minetest_game.git
synced 2024-11-05 23:33:51 +01:00
Doors: Use LBM instead of ABM to convert doors.
This works much more efficiently to replace old style doors.
This commit is contained in:
parent
0ca43e42bc
commit
80664f9f8a
@ -203,11 +203,10 @@ function doors.register(name, def)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- replace old doors of this type automatically
|
-- replace old doors of this type automatically
|
||||||
minetest.register_abm({
|
minetest.register_lbm({
|
||||||
|
name = ":doors:replace_" .. name:gsub(":", "_"),
|
||||||
nodenames = {name.."_b_1", name.."_b_2"},
|
nodenames = {name.."_b_1", name.."_b_2"},
|
||||||
interval = 7.0,
|
action = function(pos, node)
|
||||||
chance = 1,
|
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
||||||
local l = tonumber(node.name:sub(-1))
|
local l = tonumber(node.name:sub(-1))
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local h = meta:get_int("right") + 1
|
local h = meta:get_int("right") + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user