mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2025-01-01 10:17:33 +01:00
slight change in the teleporters file and add luacontroller detection
This commit is contained in:
parent
a2f59a0b6d
commit
d095fecefa
@ -57,11 +57,7 @@ local function get_selection_formspec(pname, selected_template)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function is_luacontroller(pos)
|
local function is_luacontroller(pos)
|
||||||
local node = minetest.get_node(pos)
|
return string.match(minetest.get_node(pos).name, "mesecons_luacontroller:luacontroller%d%d%d%d")
|
||||||
if node.name ~= ":luacontroller" then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_tool("moremesecons_luacontroller_tool:luacontroller_template_tool", {
|
minetest.register_tool("moremesecons_luacontroller_tool:luacontroller_template_tool", {
|
||||||
|
@ -3,8 +3,7 @@ local teleporters_rids = {}
|
|||||||
|
|
||||||
|
|
||||||
local register = function(pos)
|
local register = function(pos)
|
||||||
local RID = vector.get_data_from_pos(teleporters_rids, pos.z,pos.y,pos.x)
|
if not vector.get_data_from_pos(teleporters_rids, pos.z,pos.y,pos.x) then
|
||||||
if not RID then
|
|
||||||
table.insert(teleporters, pos)
|
table.insert(teleporters, pos)
|
||||||
vector.set_data_to_pos(teleporters_rids, pos.z,pos.y,pos.x, #teleporters)
|
vector.set_data_to_pos(teleporters_rids, pos.z,pos.y,pos.x, #teleporters)
|
||||||
end
|
end
|
||||||
@ -89,8 +88,9 @@ minetest.register_node("moremesecons_teleporter:teleporter", {
|
|||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"moremesecons_teleporter:teleporter"},
|
nodenames = {"moremesecons_teleporter:teleporter"},
|
||||||
interval=1,
|
interval=5,
|
||||||
chance=1,
|
chance=1,
|
||||||
|
catch_up = false,
|
||||||
action = function(pos)
|
action = function(pos)
|
||||||
register(pos)
|
register(pos)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user