This commit is contained in:
kepler155c
2018-10-29 22:00:59 -04:00
parent f24aeb135d
commit 871f44a170
10 changed files with 129 additions and 25 deletions

View File

@@ -132,10 +132,11 @@ end
function Milo:getTurtleInventory()
local list = { }
for i = 1,16 do
-- TODO: update item db
local item = self.context.introspectionModule.getInventory().getItemMeta(i)
if item then
itemDB:add(item)
if not itemDB:get(item) then
itemDB:add(item)
end
list[i] = item
end
end
@@ -211,7 +212,8 @@ function Milo:mergeResources(t)
item = Util.shallowCopy(v)
item.count = 0
item.key = self:uniqueKey(v)
table.insert(t, item)
-- table.insert(t, item)
t[item.key] = item
end
end
@@ -222,11 +224,19 @@ function Milo:mergeResources(t)
item = Util.shallowCopy(v)
item.count = 0
item.key = self:uniqueKey(v)
table.insert(t, item)
t[item.key] = item
-- table.insert(t, item)
end
item.has_recipe = true
end
for key in pairs(Craft.machineLookup) do
local item = t[key]
if item then
item.is_craftable = true
end
end
for _,v in pairs(t) do
if not v.displayName then
v.displayName = itemDB:getName(v)