mirror of
https://github.com/minetest-mods/technic.git
synced 2024-09-30 08:10:42 +02:00
move out switching station run function
This commit is contained in:
parent
6710c2875b
commit
8c0481ed5e
|
@ -7,11 +7,10 @@ dofile(path.."/LV/init.lua")
|
||||||
dofile(path.."/MV/init.lua")
|
dofile(path.."/MV/init.lua")
|
||||||
dofile(path.."/HV/init.lua")
|
dofile(path.."/HV/init.lua")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dofile(path.."/switching_station.lua")
|
dofile(path.."/switching_station.lua")
|
||||||
|
dofile(path.."/switching_station_globalstep.lua")
|
||||||
|
|
||||||
dofile(path.."/power_monitor.lua")
|
dofile(path.."/power_monitor.lua")
|
||||||
dofile(path.."/supply_converter.lua")
|
dofile(path.."/supply_converter.lua")
|
||||||
|
|
||||||
dofile(path.."/other/init.lua")
|
dofile(path.."/other/init.lua")
|
||||||
|
|
||||||
|
|
|
@ -258,12 +258,7 @@ local function run_nodes(list, run_stage)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_abm({
|
technic.switching_station_run = function(pos)
|
||||||
nodenames = {"technic:switching_station"},
|
|
||||||
label = "Switching Station", -- allows the mtt profiler to profile this abm individually
|
|
||||||
interval = 1.1,
|
|
||||||
chance = 1,
|
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
||||||
if not technic.powerctrl_state then return end
|
if not technic.powerctrl_state then return end
|
||||||
|
|
||||||
local t0 = minetest.get_us_time()
|
local t0 = minetest.get_us_time()
|
||||||
|
@ -490,8 +485,7 @@ minetest.register_abm({
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end,
|
end
|
||||||
})
|
|
||||||
|
|
||||||
-- Timeout ABM
|
-- Timeout ABM
|
||||||
-- Timeout for a node in case it was disconnected from the network
|
-- Timeout for a node in case it was disconnected from the network
|
||||||
|
|
11
technic/machines/switching_station_globalstep.lua
Normal file
11
technic/machines/switching_station_globalstep.lua
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"technic:switching_station"},
|
||||||
|
label = "Switching Station",
|
||||||
|
interval = 1.1,
|
||||||
|
chance = 1,
|
||||||
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
technic.switching_station_run(pos)
|
||||||
|
end
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user