Bearbeiten von „Modul:GetRecipes“
Aus Eco - Deutsches Wiki
Deine Änderungen werden angezeigt, sobald ein dazu berechtigter Benutzer sie akzeptiert hat. (Hilfe)
Die Bearbeitung kann rückgängig gemacht werden. Bitte prüfe den Vergleich unten, um sicherzustellen, dass du dies tun möchtest, und veröffentliche dann unten deine Änderungen, um die Bearbeitung rückgängig zu machen.
Aktuelle Version | Dein Text | ||
Zeile 2: | Zeile 2: | ||
local p = {} | local p = {} | ||
local Utils = require(' | local Utils = require('Modul:Utils') | ||
-- Main entry point for the Module | -- Main entry point for the Module | ||
Zeile 18: | Zeile 18: | ||
-- load list of recipes | -- load list of recipes | ||
local completeList = require(" | local completeList = require("Modul:CraftingRecipes") | ||
local recipeList = completeList.recipes | local recipeList = completeList.recipes | ||
local ingredientsList = completeList.ingredients | local ingredientsList = completeList.ingredients | ||
Zeile 30: | Zeile 30: | ||
-- load CraftingParser | -- load CraftingParser | ||
local parser = require(" | local parser = require("Modul:CraftingParser") | ||
-- priority: item > tag > table > group | -- priority: item > tag > table > group | ||
Zeile 55: | Zeile 55: | ||
end | end | ||
end | end | ||
local itemIngredients | local itemIngredients | ||
-- HACK Attempt to handle issue with tool recipes | -- HACK Attempt to handle issue with tool recipes | ||
if ingredientsList[item] and #ingredientsList[item] == 1 and ingredientsList[item][1] == '' then | if ingredientsList[item] and #ingredientsList[item] == 1 and ingredientsList[item][1] == '' then | ||
Zeile 64: | Zeile 62: | ||
itemIngredients = ingredientsList[item] | itemIngredients = ingredientsList[item] | ||
end | end | ||
if itemIngredients ~= nil then | if itemIngredients ~= nil then | ||
for _, itemIngredient in pairs(itemIngredients) do | for _, itemIngredient in pairs(itemIngredients) do | ||
if itemIngredient ~= '' then | if itemIngredient ~= '' then | ||
if recipeList[itemIngredient] ~= nil then | if recipeList[itemIngredient] ~= nil then | ||
table.insert(ingredients, recipeList[itemIngredient]) | table.insert(ingredients, recipeList[itemIngredient]) | ||
-- HACK: Skill books don't show us as a product of research pages, only the skill name. | -- HACK: Skill books don't show us as a product of research pages, only the skill name. | ||
elseif recipeList[itemIngredient .. ' Skill Book'] ~= nil then | elseif recipeList[itemIngredient .. ' Skill Book'] ~= nil then | ||
table.insert(ingredients, recipeList[itemIngredient .. ' Skill Book']) | table.insert(ingredients, recipeList[itemIngredient .. ' Skill Book']) | ||
end | end | ||
end | end |