refined storage initial update - wip
This commit is contained in:
@@ -202,28 +202,6 @@ function MEAdapter:isCrafting(item)
|
||||
end
|
||||
end
|
||||
|
||||
function MEAdapter:craftItems(items)
|
||||
local cpus = self.getCraftingCPUs() or { }
|
||||
local count = 0
|
||||
|
||||
for _,cpu in pairs(cpus) do
|
||||
if cpu.busy then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
for _,item in pairs(items) do
|
||||
if count >= #cpus then
|
||||
break
|
||||
end
|
||||
if not self:isCrafting(item) then
|
||||
if self:craft(item, item.count) then
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function MEAdapter:provide(item, qty, slot, direction)
|
||||
return pcall(function()
|
||||
for _,stack in pairs(self.getAvailableItems('all')) do
|
||||
@@ -243,18 +221,6 @@ function MEAdapter:provide(item, qty, slot, direction)
|
||||
end)
|
||||
end
|
||||
|
||||
function MEAdapter:eject(item, qty, direction)
|
||||
if not _G.turtle then
|
||||
error('Only a turtle can eject')
|
||||
end
|
||||
|
||||
local s, m = pcall(function()
|
||||
self:provide(item, qty)
|
||||
_G.turtle.emptyInventory()
|
||||
end)
|
||||
return s, m
|
||||
end
|
||||
|
||||
function MEAdapter:insert(slot, count)
|
||||
local s, m = pcall(function() self.pullItem(self.direction, slot, count) end)
|
||||
if not s and m then
|
||||
|
||||
Reference in New Issue
Block a user