From d1f16ddc0a2570116c14cb68ab68af26417e6ccc Mon Sep 17 00:00:00 2001 From: kepler155c Date: Fri, 2 Feb 2018 16:29:24 -0500 Subject: [PATCH] handle AE again --- apis/chestAdapter18.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apis/chestAdapter18.lua b/apis/chestAdapter18.lua index a2a3e21..97d649b 100644 --- a/apis/chestAdapter18.lua +++ b/apis/chestAdapter18.lua @@ -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