Code: Select all
local resource_list = {}
for _, resource in pairs(data.raw.resource) do
if resource.minable.results ~= nil then
for _, results in pairs(resource.minable.results) do
if results.type == "item" then
resource_list[#resource_list + 1] = { results.name, 1 }
end
end
elseif resource.minable.result ~= nil then
resource_list[#resource_list + 1] = { resource.minable.result, 1 }
end
end
for _, resource in ipairs(resource_list) do
data:extend({
{
type = "recipe",
name = "transmute-" .. resource[1],
subgroup = "raw-resource",
ingredients = resource_list,
results = {{ resource[1], #resource_list }}
}
})
end
With just the basegame and this mod everything works as intended.
But when I add a full angels, bobs, madclown I have 30+ ore types and the game crashes (one core full cpu load) when I hover above the recipe with my mouse.