diff --git a/data.lua b/data.lua index 0d2c1ffa..82439f07 100644 --- a/data.lua +++ b/data.lua @@ -123,7 +123,7 @@ require("prototypes.buildings.ulric-corral") require("prototypes.buildings.borax-mine") require("prototypes.buildings.ralesia-plantation") require("prototypes.buildings.niobium-mine") -require("prototypes.buildings.ore-crusher") +require("prototypes.buildings.jaw-crusher") require("prototypes.buildings.ball-mill") require("prototypes.buildings.mukmoux-pasture") require("prototypes.buildings.py-tank-1500") diff --git a/migrations/PyCoalProcessing_0.3.5.json b/migrations/PyCoalProcessing_0.3.5.json new file mode 100644 index 00000000..48cb4493 --- /dev/null +++ b/migrations/PyCoalProcessing_0.3.5.json @@ -0,0 +1,6 @@ +{ + "entity": + [ + ["ore-crusher", "jaw-crusher"] + ] +} diff --git a/prototypes/buildings/ore-crusher.lua b/prototypes/buildings/jaw-crusher.lua similarity index 93% rename from prototypes/buildings/ore-crusher.lua rename to prototypes/buildings/jaw-crusher.lua index 15386407..4c2a53db 100644 --- a/prototypes/buildings/ore-crusher.lua +++ b/prototypes/buildings/jaw-crusher.lua @@ -20,7 +20,7 @@ local recipe1={ local item1={ type = "item", name = "jaw-crusher", - icon = "__pycoalprocessing__/graphics/icons/ore-crusher.png", + icon = "__pycoalprocessing__/graphics/icons/jaw-crusher.png", flags = {"goes-to-quickbar"}, subgroup = "coal-processing", order = "s", @@ -32,7 +32,7 @@ local item1={ local entity1={ type = "assembling-machine", name = "jaw-crusher", - icon = "__pycoalprocessing__/graphics/icons/ore-crusher.png", + icon = "__pycoalprocessing__/graphics/icons/jaw-crusher.png", flags = {"placeable-neutral","player-creation"}, minable = {mining_time = 1, result = "jaw-crusher"}, fast_replaceable_group = "jaw-crusher", @@ -60,7 +60,7 @@ local entity1={ animation ={ layers={ { - filename = "__pycoalprocessing__/graphics/entity/ore-crusher/sprite-left.png", + filename = "__pycoalprocessing__/graphics/entity/jaw-crusher/sprite-left.png", width = 96, height = 256, line_length = 21, @@ -69,7 +69,7 @@ local entity1={ animation_speed = 0.85, }, { - filename = "__pycoalprocessing__/graphics/entity/ore-crusher/sprite-mid.png", + filename = "__pycoalprocessing__/graphics/entity/jaw-crusher/sprite-mid.png", width = 96, height = 256, line_length = 21, @@ -78,7 +78,7 @@ local entity1={ animation_speed = 0.85, }, { - filename = "__pycoalprocessing__/graphics/entity/ore-crusher/sprite-right.png", + filename = "__pycoalprocessing__/graphics/entity/jaw-crusher/sprite-right.png", width = 32, height = 256, line_length = 64, diff --git a/prototypes/item-groups.lua b/prototypes/item-groups.lua index 82eef5d8..766188ef 100644 --- a/prototypes/item-groups.lua +++ b/prototypes/item-groups.lua @@ -124,4 +124,10 @@ data:extend{ group = "coal-processing", order = "z", }, + { + type = "item-subgroup", + name = "py-unsorted", + group = "coal-processing", + order = "zzzz", + }, } diff --git a/prototypes/recipes/advanced-foundry-recipes.lua b/prototypes/recipes/advanced-foundry-recipes.lua index 687b4274..2140452c 100644 --- a/prototypes/recipes/advanced-foundry-recipes.lua +++ b/prototypes/recipes/advanced-foundry-recipes.lua @@ -18,8 +18,8 @@ local nexelit_plate ={ }, main_product= "nexelit-plate", icon = "__pycoalprocessing__/graphics/icons/nexelit-plate.png", - subgroup = "py-items", - order = "a1", + subgroup = "py-items", + order = "a1", } ------------------------------------------------------------------------------- --STEEL PLATE - cant change the base one,so i did that. @@ -32,7 +32,7 @@ local steel_plate2 ={ ingredients ={ {type="item", name="crushed-iron", amount=2}, {type="item", name="coke", amount=2}, - {type="item", name="fuelrod-mk01", amount=1}, + {type="item", name="fuelrod-mk01", amount=1}, {type="item", name="limestone", amount=2}, {type="item", name="sand-casting", amount=1}, }, @@ -42,57 +42,61 @@ local steel_plate2 ={ }, main_product= "steel-plate", icon = "__base__/graphics/icons/steel-plate.png", - subgroup = "py-items", - order = "a2", + subgroup = "py-items", + order = "a2", } +data:extend{nexelit_plate,steel_plate2} ------------------------------------------------------------------------------- --Make foundry recipes from smelting recipes with 1 ingredient. local list = {} log("Creating additional foundry recipes") -local _filter_ing = function(v) - return v.category == "smelting" and (v.ingredients and #v.ingredients == 1) or (v.normal and v.normal.ingredients and #v.normal.ingredients == 1) end - - for _, recipe in pairs(table.filter(data.raw.recipe, _filter_ing)) do - local ing1 = (recipe.ingredients and recipe.ingredients[1].name and recipe.ingredients[1]) - or (recipe.ingredients and {type="item", name=recipe.ingredients[1][1], amount=recipe.ingredients[1][2] * 5}) - ing1 = ing1 or (recipe.normal and recipe.normal.ingredients and recipe.normal.ingredients[1].name and recipe.normal.ingredients[1]) - or (recipe.normal and {type="item", name=recipe.normal.ingredients[1][1], amount=recipe.normal.ingredients[1][2] * 5}) +local _filter_ing = function(v) + return v.category == "smelting" and (v.ingredients and #v.ingredients == 1) or (v.normal and v.normal.ingredients and #v.normal.ingredients == 1) +end - local res - if recipe.result then - res = {{type = "item", name = recipe.result or recipe.result[1], amount = 8}} - elseif recipe.results then - res = table.deepcopy(recipe.results) - elseif recipe.normal.result then - res = {{type = "item", name = recipe.normal.result or recipe.normal.result[1], amount = 8}} - elseif recipe.normal.results then - res = table.deepcopy(recipe.normal.results) - end +for _, recipe in pairs(table.filter(data.raw.recipe, _filter_ing)) do + local ing1 = (recipe.ingredients and recipe.ingredients[1].name and recipe.ingredients[1]) + or (recipe.ingredients and {type="item", name=recipe.ingredients[1][1], amount=recipe.ingredients[1][2] * 5}) + ing1 = ing1 or (recipe.normal and recipe.normal.ingredients and recipe.normal.ingredients[1].name and recipe.normal.ingredients[1]) + or (recipe.normal and {type="item", name=recipe.normal.ingredients[1][1], amount=recipe.normal.ingredients[1][2] * 5}) - local new = { - type = "recipe", - name = "advanced-foundry-"..recipe.name, - category = "advanced-foundry", - enabled = true, - energy_required = 3, - ingredients = { - ing1, - {type="item", name="fuelrod-mk01", amount=1}, - {type="item", name="limestone", amount=2}, - {type="item", name="sand-casting", amount=1}, - }, - results = res, - icon = recipe.icon, - icons = recipe.icons, - main_product = data.raw.item[res[1].name] and res[1].name or nil - } - log(new.name) - list[#list+1] = new + local res + if recipe.result then + res = {{type = "item", name = recipe.result or recipe.result[1], amount = 8}} + elseif recipe.results then + res = table.deepcopy(recipe.results) + elseif recipe.normal.result then + res = {{type = "item", name = recipe.normal.result or recipe.normal.result[1], amount = 8}} + elseif recipe.normal.results then + res = table.deepcopy(recipe.normal.results) end - data:extend(list) - data:extend{nexelit_plate,steel_plate2} + local new = { + type = "recipe", + name = "advanced-foundry-"..recipe.name, + category = "advanced-foundry", + enabled = true, + energy_required = 3, + ingredients = { + ing1, + {type="item", name="fuelrod-mk01", amount=1}, + {type="item", name="limestone", amount=2}, + {type="item", name="sand-casting", amount=1}, + }, + results = res, + icon = recipe.icon, + icons = recipe.icons, + main_product = data.raw.item[res[1].name] and res[1].name or nil + } + log(new.name) + if not new.main_product then + new.subgroup = "py-unsorted" + new.order = "a" + end + list[#list+1] = new +end +data:extend(list) diff --git a/prototypes/updates/bob-updates.lua b/prototypes/updates/bob-updates.lua index 6339acb2..ab036a47 100644 --- a/prototypes/updates/bob-updates.lua +++ b/prototypes/updates/bob-updates.lua @@ -97,9 +97,9 @@ replace_ing("ralesia-plantation", "stone", "glass") replace_ing("ulric-corral", "iron-gear-wheel", "steel-bearing") replace_ing("ulric-corral", "electronic-circuit", "basic-circuit-board") -replace_ing("ore-crusher", "steel-plate", "invar-alloy") +replace_ing("jaw-crusher", "steel-plate", "invar-alloy") replace_ing("ore-chusher", "electronic-circuit", "basic-electronic-circuit-board") -add_ing("ore-crusher", {name="rubber", amount=10}) +add_ing("jaw-crusher", {name="rubber", amount=10}) add_ing("ball-mill", {name="steel-bearing-ball", amount=1000})