builder error on resupply page

This commit is contained in:
kepler155c
2018-04-03 13:11:38 -04:00
parent b712accfc0
commit 0bda31a574
3 changed files with 6 additions and 7 deletions

View File

@@ -119,12 +119,8 @@ function supplyPage:enable(builder)
Event.addNamedTimer('supplyRefresh', 6, true, function()
if self.enabled then
debug('timer')
self.builder:autocraft(self.builder:getSupplies())
pcall(function()
debug('refreshing')
self:refresh()
end)
self:refresh()
self.statusBar:timedStatus('Refreshed ', 2)
self:sync()
end
@@ -133,7 +129,6 @@ debug('timer')
end
function supplyPage:disable()
debug('canceling')
Event.cancelNamedTimer('supplyRefresh')
end
@@ -158,6 +153,8 @@ function supplyPage:refresh()
self.statusBar:timedStatus('Refreshed ', 3)
local supplies = self.builder:getSupplies()
if #supplies == 0 then
UI:setPage('blank')
self:sync()
self.builder:build()
else
self:setSupplies(supplies)

View File

@@ -110,7 +110,8 @@ function ChestAdapter:getItemInfo(item)
self:listItems()
end
local key = table.concat({ item.name, item.damage, item.nbtHash }, ':')
return self.cache[key]
local items = self.cache or { }
return items[key]
end
function ChestAdapter:getPercentUsed()

View File

@@ -723,6 +723,7 @@ function startPage:eventHandler(event)
elseif event.type == 'begin' then
UI:setPage('blank')
self:sync()
print('Reloading schematic')
Builder:reloadSchematic(Util.throttle())