Skip to content

Commit

Permalink
The vanilla oil refinery is now hidden from factoriopedia.
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon committed Jan 22, 2025
1 parent 9dc8f21 commit 52009e0
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 78 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Date: ?
Changes:
- Migrated the internal name of the "vacuum-tube-electronics" technology to "electronics". Resolves https://github.com/pyanodon/pybugreports/issues/453
- Migrated the internal name of the "railway-mk01" technology to "railway". Resolves https://github.com/pyanodon/pybugreports/issues/453
- The vanilla oil refinery is now hidden from factoriopedia.
---------------------------------------------------------------------------------------------------
Version: 3.0.12
Date: 2025-1-20
Expand Down
76 changes: 1 addition & 75 deletions data-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,12 @@ end

require "prototypes/updates/tholin-overhaul"

--ADAPTATIONS

--TECHNOLOGY('advanced-material-processing'):remove_pack('logistic-science-pack'):remove_prereq('logistic-science-pack')

--RECIPES UPDATES

RECIPE("lab-instrument"):add_ingredient {type = "item", name = "small-parts-01", amount = 5}:add_ingredient {type = "item", name = "rubber", amount = 10}
RECIPE("chemical-science-pack"):add_ingredient {type = "item", name = "rubber", amount = 10}
RECIPE("electric-engine-unit"):add_ingredient {type = "item", name = "small-parts-02", amount = 10}
RECIPE("engine-unit"):remove_ingredient("small-parts-01"):add_ingredient {type = "item", name = "small-parts-01", amount = 40}:set_fields {energy_required = 15}
--RECIPE("assembling-machine-2"):add_ingredient({type = "item", name = "small-parts-01", amount = 10})
RECIPE("assembling-machine-3"):add_ingredient {type = "item", name = "small-parts-02", amount = 15}
RECIPE("fast-transport-belt"):remove_ingredient("small-parts-01"):add_ingredient {type = "item", name = "small-parts-02", amount = 2}
RECIPE("fast-underground-belt"):remove_ingredient("small-parts-01"):add_ingredient {type = "item", name = "small-parts-02", amount = 6}
Expand All @@ -37,90 +32,21 @@ RECIPE("express-splitter"):remove_ingredient("small-parts-01"):add_ingredient {t
RECIPE("carbon-filter"):remove_ingredient("assembling-machine-2"):add_ingredient {type = "item", name = "assembling-machine-1", amount = 2}
RECIPE("rectisol"):remove_ingredient("assembling-machine-2"):add_ingredient {type = "item", name = "assembling-machine-1", amount = 2}
RECIPE("small-parts-03"):replace_ingredient("glass", "glass-fiber"):replace_ingredient("tin-plate", "aerogel")
--RECIPE("tall-oil-combustion"):remove_unlock('energy-2'):add_unlock('energy-1')
RECIPE("utility-science-pack"):add_ingredient {type = "item", name = "small-parts-03", amount = 30}
RECIPE("rail"):replace_ingredient("iron-stick", {type = "item", name = "bolts", amount = 4})

--Base Updates

data.raw["rocket-silo"]["rocket-silo"].rocket_parts_required = 15

local remove_old_oil_stuff =
{
["pumpjack"] = true,
["oil-refinery"] = true,
["basic-oil-processing"] = true,
["advanced-oil-processing"] = true,
["heavy-oil-cracking"] = true,
["light-oil-cracking"] = true,
["coal-liquefaction"] = true
}

local recipes_to_keep = {}

--log(serpent.block(remove_old_oil_stuff))

for _, recipe in pairs(data.raw.technology["oil-processing"].effects) do
--log('hit')
if recipe.type == "unlock-recipe" then
--log('hit')
--log(recipe.recipe)
if remove_old_oil_stuff[recipe.recipe] == nil then
--log('hit')
table.insert(recipes_to_keep, recipe)
end
end
end

data.raw.technology["oil-processing"].effects = recipes_to_keep
recipes_to_keep = {}

for _, recipe in pairs(data.raw.technology["advanced-oil-processing"].effects) do
if recipe.type == "unlock-recipe" then
if remove_old_oil_stuff[recipe.recipe] == nil then
table.insert(recipes_to_keep, recipe)
end
end
end

data.raw.technology["advanced-oil-processing"].effects = recipes_to_keep
recipes_to_keep = {}

for _, recipe in pairs(data.raw.technology["coal-liquefaction"].effects) do
if recipe.type == "unlock-recipe" then
if remove_old_oil_stuff[recipe.recipe] == nil then
table.insert(recipes_to_keep, recipe)
end
end
end

data.raw.technology["coal-liquefaction"].effects = recipes_to_keep

data.raw.planet.nauvis.map_gen_settings.autoplace_controls["crude-oil"] = nil
data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["crude-oil"] = nil

for _, preset in pairs(data.raw["map-gen-presets"]["default"]) do
if preset and preset.basic_settings and preset.basic_settings.autoplace_controls and preset.basic_settings.autoplace_controls["crude-oil"] then
preset.basic_settings.autoplace_controls["crude-oil"] = nil
end
end

if data.data_crawler then
data.script_enabled = data.script_enabled or {}
table.insert(data.script_enabled, "tar-patch")
if mods["pyhightech"] then table.insert(data.script_enabled, "crash-site-assembling-machine-1-repaired") end
end

--gather recipes for module changes
local recipes_list = {
py.allow_productivity {
"kevlar-2",
"small-parts-02",
"small-parts-03",
}

--adding to module limitation list
py.allow_productivity(recipes_list)

if register_cache_file ~= nil then
register_cache_file({"pycoalprocessing", "pyfusionenergy", "pyindustry", "pypetroleumhandling"}, "__pypetroleumhandling__/cached-configs/pycoalprocessing+pyfusionenergy+pyindustry+pypetroleumhandling")
register_cache_file({"pycoalprocessing", "pyfusionenergy", "pyindustry", "pyhightech", "pypetroleumhandling"}, "__pypetroleumhandling__/cached-configs/pycoalprocessing+pyfusionenergy+pyhightech+pyindustry+pypetroleumhandling")
Expand Down
47 changes: 44 additions & 3 deletions prototypes/updates/base-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,50 @@ if not mods["pyrawores"] then
end

TECHNOLOGY("excavation-2"):add_pack("production-science-pack")

TECHNOLOGY("excavation-3"):add_pack("military-science-pack"):add_pack("utility-science-pack"):add_pack("space-science-pack")

--RECIPE("oil-refinery"):add_unlock("scrude")

data.raw.item["oil-refinery"].hidden = true
TECHNOLOGY("oil-processing"):remove_pack("chemical-science-pack")

data.raw["rocket-silo"]["rocket-silo"].rocket_parts_required = 15

local remove_old_oil_stuff = {
["pumpjack"] = true,
["oil-refinery"] = true,
["basic-oil-processing"] = true,
["advanced-oil-processing"] = true,
["heavy-oil-cracking"] = true,
["light-oil-cracking"] = true,
["coal-liquefaction"] = true
}

local vanilla_techs_to_delete_recipes_from = {
"oil-processing",
"advanced-oil-processing",
"coal-liquefaction",
}

for _, tech_name in pairs(vanilla_techs_to_delete_recipes_from) do
local tech = data.raw.technology[tech_name]
local recipes_to_keep = {}
for _, recipe in pairs(tech.effects) do
if recipe.type == "unlock-recipe" then
if remove_old_oil_stuff[recipe.recipe] then
recipe.hidden = true
recipe.hidden_in_factoriopedia = true
else
table.insert(recipes_to_keep, recipe)
end
end
end
tech.effects = recipes_to_keep
end

data.raw.planet.nauvis.map_gen_settings.autoplace_controls["crude-oil"] = nil
data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["crude-oil"] = nil

for _, preset in pairs(data.raw["map-gen-presets"]["default"]) do
if preset and preset.basic_settings and preset.basic_settings.autoplace_controls and preset.basic_settings.autoplace_controls["crude-oil"] then
preset.basic_settings.autoplace_controls["crude-oil"] = nil
end
end

0 comments on commit 52009e0

Please sign in to comment.