Lora major refactor
This commit is contained in:
24
inventoryManager/plugins/autocraftTask.lua
Normal file
24
inventoryManager/plugins/autocraftTask.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
local Lora = require('lora/lora')
|
||||
local Util = require('util')
|
||||
|
||||
local Autocraft = {
|
||||
priority = 100,
|
||||
}
|
||||
|
||||
function Autocraft:cycle(context)
|
||||
local list = { }
|
||||
|
||||
for _,res in pairs(context.resources) do
|
||||
if res.auto then
|
||||
res = Util.shallowCopy(res)
|
||||
res.count = 256
|
||||
list[Lora:uniqueKey(res)] = res
|
||||
end
|
||||
end
|
||||
|
||||
if not Util.empty(list) then
|
||||
Lora:craftItems(list)
|
||||
end
|
||||
end
|
||||
|
||||
Lora:registerTask(Autocraft)
|
||||
Reference in New Issue
Block a user