1.7.10 compatibility
This commit is contained in:
@@ -81,6 +81,8 @@ function ChestAdapter:listItems()
|
||||
local cache = { }
|
||||
local items = { }
|
||||
|
||||
-- getAllStacks sometimes fails
|
||||
pcall(function()
|
||||
for _,v in pairs(self.getAllStacks(false)) do
|
||||
convertItem(v)
|
||||
local key = table.concat({ v.name, v.damage, v.nbtHash }, ':')
|
||||
@@ -102,6 +104,7 @@ function ChestAdapter:listItems()
|
||||
self.cache = cache
|
||||
return items
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ChestAdapter:getItemInfo(item)
|
||||
@@ -119,7 +122,8 @@ function ChestAdapter:craftItems()
|
||||
end
|
||||
|
||||
function ChestAdapter:provide(item, qty, slot, direction)
|
||||
for key,stack in pairs(self.getAllStacks(false)) do
|
||||
pcall(function()
|
||||
for key,stack in Util.rpairs(self.getAllStacks(false)) do
|
||||
if stack.id == item.name and
|
||||
stack.dmg == item.damage and
|
||||
stack.nbt_hash == item.nbtHash then
|
||||
@@ -132,6 +136,7 @@ function ChestAdapter:provide(item, qty, slot, direction)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ChestAdapter:extract(slot, qty, toSlot)
|
||||
|
||||
Reference in New Issue
Block a user