Stop using metatable it doesn't work
This commit is contained in:
parent
642135ca15
commit
90f537d6bf
|
@ -8,13 +8,15 @@ local driver = {}
|
||||||
|
|
||||||
local ItemStack = {}
|
local ItemStack = {}
|
||||||
|
|
||||||
function ItemStack.new(item)
|
local function ItemStack_new(item)
|
||||||
checkArg(1, item, "table");
|
checkArg(1, item, "table");
|
||||||
local out = {
|
local out = {
|
||||||
data = item.getValue1(),
|
data = item.getValue1(),
|
||||||
quantity = item.getValue2()
|
quantity = item.getValue2()
|
||||||
}
|
}
|
||||||
setmetatable(out, ItemStack)
|
for k,v in pairs(ItemStack) do
|
||||||
|
out[k] = v
|
||||||
|
end
|
||||||
return out
|
return out
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -43,7 +45,7 @@ function driver.getItems()
|
||||||
end
|
end
|
||||||
local output = {}
|
local output = {}
|
||||||
for _,item in pairs(pipe.getAvailableItems()) do
|
for _,item in pairs(pipe.getAvailableItems()) do
|
||||||
table.insert(output, ItemStack.new(item))
|
table.insert(output, ItemStack_new(item))
|
||||||
end
|
end
|
||||||
return output
|
return output
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue