fix Script bug + crafter
This commit is contained in:
@@ -126,22 +126,9 @@ end
|
||||
function ChestAdapter:craftItems()
|
||||
end
|
||||
|
||||
local function rpairs(t)
|
||||
local tkeys = Util.keys(t)
|
||||
local i = #tkeys
|
||||
return function()
|
||||
local key = tkeys[i]
|
||||
local k,v = key, t[key]
|
||||
i = i - 1
|
||||
if v then
|
||||
return k, v
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ChestAdapter:provide(item, qty, slot, direction)
|
||||
local stacks = self.list()
|
||||
for key,stack in rpairs(stacks) do
|
||||
for key,stack in Util.rpairs(stacks) do
|
||||
if stack.name == item.name and stack.damage == item.damage then
|
||||
local amount = math.min(qty, stack.count)
|
||||
if amount > 0 then
|
||||
|
||||
Reference in New Issue
Block a user