1.7.10 compatibility
This commit is contained in:
@@ -77,9 +77,10 @@ function ChestAdapter:refresh(throttle)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- provide a consolidated list of items
|
-- provide a consolidated list of items
|
||||||
function ChestAdapter:listItems()
|
function ChestAdapter:listItems(throttle)
|
||||||
local cache = { }
|
local cache = { }
|
||||||
local items = { }
|
local items = { }
|
||||||
|
throttle = throttle or Util.throttle()
|
||||||
|
|
||||||
-- getAllStacks sometimes fails
|
-- getAllStacks sometimes fails
|
||||||
pcall(function()
|
pcall(function()
|
||||||
@@ -89,15 +90,14 @@ function ChestAdapter:listItems()
|
|||||||
|
|
||||||
local entry = cache[key]
|
local entry = cache[key]
|
||||||
if not entry then
|
if not entry then
|
||||||
cache[key] = v
|
entry = itemDB:get(v) or itemDB:add(v)
|
||||||
|
entry = Util.shallowCopy(entry)
|
||||||
if not itemDB:get(v) then
|
entry.count = 0
|
||||||
itemDB:add(v)
|
cache[key] = entry
|
||||||
|
table.insert(items, entry)
|
||||||
end
|
end
|
||||||
table.insert(items, v)
|
|
||||||
else
|
|
||||||
entry.count = entry.count + v.count
|
entry.count = entry.count + v.count
|
||||||
end
|
throttle()
|
||||||
end
|
end
|
||||||
itemDB:flush()
|
itemDB:flush()
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -1091,6 +1091,7 @@ local function learnRecipe(page)
|
|||||||
listingPage:refresh()
|
listingPage:refresh()
|
||||||
listingPage.grid:draw()
|
listingPage.grid:draw()
|
||||||
|
|
||||||
|
inventoryAdapter:eject(recipe, recipe.count, 'front')
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user