milo storage filter + crafting fixes

This commit is contained in:
kepler155c
2018-10-28 15:24:12 -04:00
parent 9d45460a3b
commit 1c70085450
8 changed files with 177 additions and 168 deletions

View File

@@ -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