fix when flake graphite is off
This commit is contained in:
parent
6272ffadba
commit
b1173d6080
7 changed files with 45 additions and 23 deletions
|
@ -90,7 +90,7 @@ if not util.me.use_flake_graphite() then
|
|||
type = "recipe",
|
||||
name = "graphite",
|
||||
icon = "__bzcarbon__/graphics/icons/graphite.png", icon_size=128,
|
||||
category = mods.bzfoundry and "founding" or "advanced-crafting",
|
||||
category = mods.bzfoundry and "founding" or "crafting",
|
||||
order = "d[graphite]",
|
||||
enabled = false,
|
||||
energy_required = 0.5,
|
||||
|
@ -104,7 +104,7 @@ if not util.me.use_flake_graphite() then
|
|||
type = "recipe",
|
||||
name = "graphite",
|
||||
icon = "__bzcarbon__/graphics/icons/graphite.png", icon_size=128,
|
||||
category = mods.bzfoundry and "founding" or "advanced-crafting",
|
||||
category = mods.bzfoundry and "founding" or "crafting",
|
||||
subgroup = data.raw.item.graphite.subgroup,
|
||||
order = "d[graphite]",
|
||||
enabled = false,
|
||||
|
@ -117,9 +117,7 @@ if not util.me.use_flake_graphite() then
|
|||
util.add_prerequisite("graphite-processing", "foundry")
|
||||
|
||||
-- Increase richness of coal a bit
|
||||
local noise = require('noise');
|
||||
data.raw.resource["coal"].autoplace.richness_expression =
|
||||
data.raw.resource["coal"].autoplace.richness_expression * noise.to_noise_expression(1.5)
|
||||
data.raw.resource["coal"].autoplace.richness_expression = data.raw.resource["coal"].autoplace.richness_expression.." * 1.5"
|
||||
end
|
||||
|
||||
|
||||
|
@ -573,7 +571,11 @@ if mods["space-exploration"] and string.sub(mods["space-exploration"], 1, 3) ==
|
|||
end
|
||||
|
||||
-- Set early tech tree
|
||||
util.set_tech_trigger("graphite-processing", {type = "mine-entity", entity = "graphite"})
|
||||
if util.me.use_flake_graphite() then
|
||||
util.set_tech_trigger("graphite-processing", {type = "mine-entity", entity = "graphite"})
|
||||
else
|
||||
util.set_tech_trigger("graphite-processing", {type = "mine-entity", entity = "coal"})
|
||||
end
|
||||
util.add_prerequisite("graphite-processing", "steam-power")
|
||||
|
||||
if mods["space-age"] then
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
---------------------------------------------------------------------------------------------------
|
||||
Version: 2.0.6
|
||||
Date: 2025-02-05
|
||||
Fixes:
|
||||
- Fix issues when flake graphite is disabled
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 2.0.5
|
||||
Date: 2025-02-05
|
||||
Changes:
|
||||
|
|
|
@ -928,7 +928,12 @@ function add_product(recipe, product)
|
|||
if recipe ~= nil then
|
||||
if product.name and data.raw[product.type][product.name] then
|
||||
if recipe.results == nil then
|
||||
recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}}
|
||||
recipe.results = {}
|
||||
end
|
||||
for _, old in pairs(recipe.results) do
|
||||
if old.name == product.name then
|
||||
return
|
||||
end
|
||||
end
|
||||
recipe.result = nil
|
||||
recipe.result_count = nil
|
||||
|
|
19
data.lua
19
data.lua
|
@ -19,13 +19,18 @@ if mods["aai-vehicles-miner"] then
|
|||
end
|
||||
|
||||
util.add_fluid_mining()
|
||||
util.set_tech_trigger("fluid-mining", {type="craft-fluid", fluid="steam", amount=500})
|
||||
util.set_prerequisite("fluid-mining", {"steam-power"})
|
||||
util.add_unlock("steam-power", "copper-cable")
|
||||
util.add_unlock("steam-power", "small-electric-pole")
|
||||
util.set_prerequisite("electric-mining-drill", {"steam-power"})
|
||||
util.set_tech_trigger("electric-mining-drill", {type="craft-item", item="small-electric-pole", count=10})
|
||||
util.set_prerequisite("graphite-processing", {"fluid-mining", "electric-mining-drill"})
|
||||
|
||||
if util.me.use_flake_graphite() then
|
||||
util.set_tech_trigger("fluid-mining", {type="craft-fluid", fluid="steam", amount=500})
|
||||
util.set_prerequisite("fluid-mining", {"steam-power"})
|
||||
util.add_unlock("steam-power", "copper-cable")
|
||||
util.add_unlock("steam-power", "small-electric-pole")
|
||||
util.set_prerequisite("electric-mining-drill", {"steam-power"})
|
||||
util.set_tech_trigger("electric-mining-drill", {type="craft-item", item="small-electric-pole", count=10})
|
||||
util.set_prerequisite("graphite-processing", {"fluid-mining", "electric-mining-drill"})
|
||||
else
|
||||
util.set_prerequisite("graphite-processing", {})
|
||||
end
|
||||
util.add_prerequisite("uranium-processing", "sulfur-processing")
|
||||
|
||||
util.add_unlock("graphite-processing", "basic-crusher")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bzcarbon",
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.6",
|
||||
"factorio_version": "2.0",
|
||||
"title": "Graphite & Diamonds",
|
||||
"author": "Brevven",
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
local util = require("data-util");
|
||||
|
||||
if mods["space-age"] then
|
||||
local results = {
|
||||
{type = "item", name = "carbonic-asteroid-chunk", amount = 1, probability = 0.1},
|
||||
{type = "item", name = "rough-diamond", amount = 1, probability=0.5},
|
||||
}
|
||||
if util.me.use_flake_graphite() then
|
||||
table.insert(results, {type = "item", name = "flake-graphite", amount = 10})
|
||||
else
|
||||
table.insert(results, {type = "item", name = "graphite", amount = 10})
|
||||
end
|
||||
|
||||
data:extend({
|
||||
{
|
||||
type = "recipe",
|
||||
|
@ -21,12 +31,7 @@ if mods["space-age"] then
|
|||
{type = "item", name = "carbonic-asteroid-chunk", amount = 1}
|
||||
},
|
||||
energy_required = 5,
|
||||
results =
|
||||
{
|
||||
{type = "item", name = "flake-graphite", amount = 10},
|
||||
{type = "item", name = "rough-diamond", amount = 1, probability=0.5},
|
||||
{type = "item", name = "carbonic-asteroid-chunk", amount = 1, probability = 0.1}
|
||||
},
|
||||
results = results,
|
||||
allow_productivity = true,
|
||||
allow_decomposition = false
|
||||
},
|
||||
|
|
|
@ -2,6 +2,8 @@ local resource_autoplace = require('resource-autoplace');
|
|||
|
||||
local util = require("data-util");
|
||||
|
||||
if util.me.use_flake_graphite() then
|
||||
|
||||
resource_autoplace.initialize_patch_set("graphite", true)
|
||||
data.raw.planet.nauvis.map_gen_settings.autoplace_controls["graphite"] = {}
|
||||
data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["graphite"] = {}
|
||||
|
@ -10,8 +12,6 @@ if mods.tenebris then
|
|||
data.raw.planet.tenebris.map_gen_settings.autoplace_settings.entity.settings["graphite"] = {}
|
||||
end
|
||||
|
||||
|
||||
if util.me.use_flake_graphite() then
|
||||
data:extend({
|
||||
{
|
||||
type = "autoplace-control",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue