milo storage filter + crafting fixes
This commit is contained in:
@@ -6,28 +6,19 @@ local LimitTask = {
|
||||
}
|
||||
|
||||
function LimitTask:cycle(context)
|
||||
local trashcan
|
||||
local trashcan = context.storage:filterActive('trashcan')()
|
||||
|
||||
for k,v in pairs(context.config.remoteDefaults) do
|
||||
if v.mtype == 'trashcan' then
|
||||
trashcan = k
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if not trashcan then
|
||||
return
|
||||
end
|
||||
|
||||
for _,res in pairs(context.resources) do
|
||||
if res.limit then
|
||||
local item = Milo:getItemWithQty(res, res.ignoreDamage, res.ignoreNbtHash)
|
||||
if item and item.count > res.limit then
|
||||
context.storage:export(
|
||||
trashcan,
|
||||
nil,
|
||||
item.count - res.limit,
|
||||
item)
|
||||
if trashcan then
|
||||
for _,res in pairs(context.resources) do
|
||||
if res.limit then
|
||||
local item = Milo:getItemWithQty(res, res.ignoreDamage, res.ignoreNbtHash)
|
||||
if item and item.count > res.limit then
|
||||
context.storage:export(
|
||||
trashcan.name,
|
||||
nil,
|
||||
item.count - res.limit,
|
||||
item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user