1.7.10 compatibility
This commit is contained in:
@@ -208,13 +208,13 @@ end
|
|||||||
|
|
||||||
function MEAdapter:provide(item, qty, slot, direction)
|
function MEAdapter:provide(item, qty, slot, direction)
|
||||||
return pcall(function()
|
return pcall(function()
|
||||||
for _,stack in Util.rpairs(self.getAllStacks(false)) do
|
for _,stack in pairs(self.getAllStacks(false)) do
|
||||||
if stack.id == item.name and
|
if stack.item.id == item.name and
|
||||||
(not item.damage or stack.dmg == item.damage) and
|
(not item.damage or stack.item.dmg == item.damage) and
|
||||||
(not item.nbtHash or stack.nbt_hash == item.nbtHash) then
|
(not item.nbtHash or stack.item.nbt_hash == item.nbtHash) then
|
||||||
local amount = math.min(qty, stack.qty)
|
local amount = math.min(qty, stack.item.qty)
|
||||||
if amount > 0 then
|
if amount > 0 then
|
||||||
self.exportItem(stack, direction or self.direction, amount, slot)
|
self.exportItem(stack.item, direction or self.direction, amount, slot)
|
||||||
end
|
end
|
||||||
qty = qty - amount
|
qty = qty - amount
|
||||||
if qty <= 0 then
|
if qty <= 0 then
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ local config = {
|
|||||||
|
|
||||||
inventory = 'top', -- main inventory
|
inventory = 'top', -- main inventory
|
||||||
craftingChest = 'bottom', -- required in 1.8+ for crafting
|
craftingChest = 'bottom', -- required in 1.8+ for crafting
|
||||||
|
duckAntenna = false,
|
||||||
controller = 'none', -- AE / RS controller
|
controller = 'none', -- AE / RS controller
|
||||||
stock = 'none', -- another inventory for restocking main inventory
|
stock = 'none', -- another inventory for restocking main inventory
|
||||||
|
|
||||||
@@ -125,17 +126,15 @@ if not inventoryAdapter then
|
|||||||
error('Invalid inventory configuration')
|
error('Invalid inventory configuration')
|
||||||
end
|
end
|
||||||
|
|
||||||
if device.workbench then
|
if device.workbench and config.duckAntenna then
|
||||||
local oppositeSide = {
|
local oppositeSide = {
|
||||||
[ 'left' ] = 'right',
|
[ 'left' ] = 'right',
|
||||||
[ 'right' ] = 'left',
|
[ 'right' ] = 'left',
|
||||||
}
|
}
|
||||||
local duckAntennaSide = oppositeSide[device.workbench.side]
|
local duckAntennaSide = oppositeSide[device.workbench.side]
|
||||||
if Peripheral.getType(duckAntennaSide) == os.getComputerLabel() then
|
duckAntenna = Peripheral.wrap(duckAntennaSide)
|
||||||
duckAntenna = Peripheral.wrap(duckAntennaSide)
|
if duckAntenna and not duckAntenna.getAllStacks then
|
||||||
if duckAntenna and not duckAntenna.getAllStacks then
|
duckAntenna = nil
|
||||||
duckAntenna = nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user