fix Script bug + crafter

This commit is contained in:
kepler155c
2017-10-20 04:23:54 -04:00
parent 11a005969c
commit c057f98830
3 changed files with 22 additions and 40 deletions

View File

@@ -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