mirror of
https://github.com/minetest-mods/drawers.git
synced 2024-11-29 10:03:44 +01:00
Make drawer controller update interval configurable
This commit is contained in:
parent
d8e1d83fd6
commit
8702b6ac92
@ -43,6 +43,8 @@ Controllers that have no items will not continue scanning drawers. ]]--
|
|||||||
local MP = core.get_modpath(core.get_current_modname())
|
local MP = core.get_modpath(core.get_current_modname())
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
local S, NS = dofile(MP.."/intllib.lua")
|
||||||
|
|
||||||
|
local controller_interval = tonumber(core.setting_get("drawers_controller_interval"))
|
||||||
|
|
||||||
local function controller_can_dig(pos, player)
|
local function controller_can_dig(pos, player)
|
||||||
local meta = core.get_meta(pos);
|
local meta = core.get_meta(pos);
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
@ -356,7 +358,7 @@ controller_def.on_construct = function(pos)
|
|||||||
meta:set_string("drawers_table_index", "")
|
meta:set_string("drawers_table_index", "")
|
||||||
meta:set_string("formspec", controller_formspec(pos, S("Running")))
|
meta:set_string("formspec", controller_formspec(pos, S("Running")))
|
||||||
local timer = core.get_node_timer(pos)
|
local timer = core.get_node_timer(pos)
|
||||||
timer:start(7)
|
timer:start(controller_interval)
|
||||||
end
|
end
|
||||||
controller_def.on_blast = function(pos)
|
controller_def.on_blast = function(pos)
|
||||||
local drops = {}
|
local drops = {}
|
||||||
|
1
settingtypes.txt
Normal file
1
settingtypes.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
drawers_controller_interval (Drawer Controller update interval in seconds) float 7.0 0.1 10.0
|
Loading…
Reference in New Issue
Block a user