brewing station auto learn

This commit is contained in:
kepler155c
2018-10-28 03:24:32 -04:00
parent 763f6bb27a
commit b96c064431
5 changed files with 64 additions and 22 deletions

View File

@@ -153,6 +153,20 @@ function Milo:eject(item, qty)
end
end
function Milo:saveMachineRecipe(recipe, result, machine)
local key = Milo:uniqueKey(result)
-- save the recipe
self.context.userRecipes[key] = recipe
Util.writeTable(Milo.RECIPES_FILE, self.context.userRecipes)
-- save the machine association
Craft.machineLookup[key] = machine
Util.writeTable(Craft.MACHINE_LOOKUP, Craft.machineLookup)
Craft.loadRecipes()
end
function Milo:mergeResources(t)
for _,v in pairs(self.context.resources) do
local item = self:getItem(t, v)