handle AE again

This commit is contained in:
kepler155c
2018-02-02 16:29:24 -05:00
parent 86d427fd13
commit d1f16ddc0a

View File

@@ -15,9 +15,6 @@ function ChestAdapter:init(args)
local chest
if not self.side then
chest = Peripheral.getByMethod('list') or Peripheral.getByMethod('listAvailableItems')
if not chest then
chest = Peripheral.getByMethod('list')
end
else
chest = Peripheral.getBySide(self.side)
if chest and not chest.list then
@@ -28,10 +25,14 @@ function ChestAdapter:init(args)
if chest then
Util.merge(self, chest)
end
if chest.list or chest.listAvailableItems then
return chest
end
end
function ChestAdapter:isValid()
return not not self.list
return not not (self.list or self.listAvailableItems)
end
-- handle both AE/RS and generic inventory