use lbm for caching positions for those nodes

This commit is contained in:
HybridDog 2016-03-22 11:41:19 +01:00
parent 8f303f1b2a
commit 26e1fad5cc
3 changed files with 10 additions and 22 deletions

View File

@ -123,10 +123,8 @@ minetest.register_craft({
{"", "moremesecons_wireless:jammer_off", ""}}
})
minetest.register_abm({
minetest.register_lbm({
name = "moremesecons_jammer:add_jammer",
nodenames = {"moremesecons_jammer:jammer_on"},
interval = 5,
chance = 1,
catch_up = false,
action = add_jammer
})

View File

@ -73,9 +73,7 @@ minetest.register_node("moremesecons_teleporter:teleporter", {
action_on = teleport_nearest
}},
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
register(pos)
end,
on_construct = register,
on_destruct = function(pos)
local RID = vector.get_data_from_pos(teleporters_rids, pos.z,pos.y,pos.x)
if RID then
@ -86,12 +84,8 @@ minetest.register_node("moremesecons_teleporter:teleporter", {
})
minetest.register_abm({
minetest.register_lbm({
name = "moremesecons_teleporter:add_teleporter",
nodenames = {"moremesecons_teleporter:teleporter"},
interval=5,
chance=1,
catch_up = false,
action = function(pos)
register(pos)
end
action = register
})

View File

@ -185,18 +185,14 @@ minetest.register_craft({
}
})
minetest.register_abm({
minetest.register_lbm({
name = "moremesecons_wireless:add_jammer",
nodenames = {"moremesecons_wireless:jammer_on"},
interval = 5,
chance = 1,
catch_up = false,
action = add_jammer
})
minetest.register_abm({
minetest.register_lbm({
name = "moremesecons_wireless:add_wireless",
nodenames = {"moremesecons_wireless:wireless"},
interval = 5,
chance = 1,
catch_up = false,
action = register_RID
})