1.7.10 compatibility

This commit is contained in:
kepler155c
2018-02-21 09:34:22 -05:00
parent 4df6923062
commit 038e6b185b

View File

@@ -183,21 +183,23 @@ end
local function isMachineEmpty(machine, item) local function isMachineEmpty(machine, item)
local side = turtle.getAction(machine.dir).side local side = turtle.getAction(machine.dir).side
local methods = Peripheral.getMethods(side) local methods = Peripheral.getMethods(side)
local list = { } local list = { true }
debug(methods)
if methods.getAllStacks then -- 1.7x if methods.getAllStacks then -- 1.7x
list = Peripheral.call(side, 'getAllStacks', false) list = Peripheral.call(side, 'getAllStacks', false)
elseif methods.list then elseif methods.list then
list = Peripheral.call(side, 'list') list = Peripheral.call(side, 'list')
elseif methods.getProgress then elseif methods.getProgress then
if Peripheral.call(side, 'getProgress') ~= 0 then if Peripheral.call(side, 'getProgress') == 0 then
list = { true } return true
end end
else else
item.statusCode = STATUS_ERROR item.statusCode = STATUS_ERROR
item.status = 'Unable to check empty status' item.status = 'Unable to check empty status'
return
end end
debug(list)
if Util.empty(list) then if Util.empty(list) then
return true return true
end end
@@ -280,10 +282,8 @@ local function craftItem(ikey, item, items, machineStatus)
item.status = 'failed to find machine' item.status = 'failed to find machine'
item.statusCode = STATUS_ERROR item.statusCode = STATUS_ERROR
else else
if machine.empty then if machine.empty and not isMachineEmpty(machine, item) then
if not isMachineEmpty(machine, item) then return
return
end
end end
if machine.dir == 'up' then if machine.dir == 'up' then