Split mod

This commit is contained in:
Simon Brodtmann 2025-11-11 23:58:49 +01:00
parent 4ea352f466
commit f47a9121e9
101 changed files with 803 additions and 786 deletions

View file

@ -0,0 +1,53 @@
local Technology = require("__cf-lib__/data/Technology")
local Recipe = require("__cf-lib__/data/Recipe")
if not mods["aai-industry"] then return end
data.raw.recipe["wood-science-pack"].allow_hand_crafting = true
-- Technologies / Recipe unlocks
local burner_mechanics = Technology:new("burner-mechanics")
burner_mechanics:removeRecipe("burner-inserter")
burner_mechanics:removeRecipe("burner-mining-drill")
burner_mechanics:removeRecipe("burner-assembling-machine")
burner_mechanics:addPrerequisite("iron-processing")
data.raw.recipe["burner-inserter"].enabled = true
data.raw.recipe["burner-mining-drill"].enabled = true
local burner_automation = Technology:new("burner-automation")
burner_automation:addRecipe("burner-assembling-machine")
Technology:new("basic-logistics"):removeRecipe("transport-belt")
Technology:new("logistics"):addRecipe("transport-belt")
-- Electrics comes later with AAI Industry active
Recipe:new("lumber-mill-copper"):replaceIngredient("assembling-machine-1", "burner-assembling-machine")
Recipe:new("basic-construction-robot-copper"):replaceIngredient("electronic-circuit", "basic-circuit-board")
-- Entities
local wall = data.raw["wall"]["concrete-wall"]
wall.emissions_per_second = wall.emissions_per_second or {}
wall.emissions_per_second.noise = -30 / 60
data.raw["lab"]["wood-lab"].next_upgrade = "burner-lab"
table.insert(data.raw["agricultural-tower"]["burner-agricultural-tower"].energy_source.fuel_categories, "processed-chemical")
table.insert(data.raw["assembling-machine"]["fuel-processor"].energy_source.fuel_categories, "wood")
if settings.startup["lignumis-basic-circuit-board"].value then
table.insert(data.raw["recipe"]["electric-mining-drill"].ingredients, { type = "item", name = "basic-circuit-board", amount = 2 })
table.insert(data.raw["recipe"]["inserter"].ingredients, { type = "item", name = "basic-circuit-board", amount = 1 })
table.insert(data.raw["recipe"]["burner-lab"].ingredients, { type = "item", name = "basic-circuit-board", amount = 10 })
table.insert(data.raw["recipe"]["assembling-machine-1"].ingredients, { type = "item", name = "basic-circuit-board", amount = 5 })
-- AAI Industry messes with the basic circuit board recipe
Technology:new("electronics"):removeRecipe("basic-circuit-board")
data.raw.recipe["basic-circuit-board"].enabled = true
Technology:new("electricity"):removeRecipe("copper-cable")
Technology:new("copper-processing"):addRecipe("copper-cable")
end

View file

@ -0,0 +1,14 @@
local Recipe = require("__cf-lib__/data/Recipe")
if not mods["aai-loaders"] then return end
if settings.startup["aai-loaders-mode"].value == "graphics-only" then return end
local recipe = Recipe:new("aai-loader")
if settings.startup["lignumis-belt-progression"].value then
recipe:replaceIngredient("transport-belt", "aai-wood-loader", 1)
end
if mods["aai-industry"] and settings.startup["lignumis-basic-circuit-board"].value then
recipe:replaceIngredient("electronic-circuit", "basic-circuit-board")
end

View file

@ -0,0 +1,68 @@
local Recipe = require("__cf-lib__/data/Recipe")
local Technology = require("__cf-lib__/data/Technology")
if not mods["aai-loaders"] then return end
if settings.startup["aai-loaders-mode"].value == "graphics-only" then return end
local basic_circuit_board = settings.startup["lignumis-basic-circuit-board"].value
local recipe = {
ingredients = {
{ type = "item", name = "lumber", amount = 5 },
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 5 } or
{ type = "item", name = "gold-cable", amount = 10 },
{ type = "item", name = "wood-transport-belt", amount = 1 }
},
energy_required = 1
}
AAILoaders.make_tier({
name = "wood",
transport_belt = "wood-transport-belt",
color = { 163, 117, 102 },
fluid = "steam",
fluid_per_minute = 7.5,
fluid_technology_prerequisites = { "gold-fluid-handling" },
technology = {
unit = {
count = 25,
ingredients = { { "wood-science-pack", 1 } },
time = 15
},
prerequisites = { "wood-logistics" }
},
recipe = recipe,
unlubricated_recipe = mods["aai-loaders-sane"] and recipe or {
ingredients = {
{ type = "item", name = "lumber", amount = 50 },
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 50 } or
{ type = "item", name = "gold-cable", amount = 100 },
{ type = "item", name = "wood-transport-belt", amount = 1 }
},
energy_required = 5
},
next_upgrade = "aai-loader",
localise = false,
order = "d[loader]-a00[aai-wood-loader]"
})
data.raw.recipe["aai-wood-loader"].category = "wood-processing-or-assembling"
if not basic_circuit_board then
local nauvis_recipe = Recipe:new("aai-wood-loader"):clone("wood-loader-electronic-circuit")
nauvis_recipe:replaceIngredient("gold-cable", "electronic-circuit")
nauvis_recipe:unlockedByTechnology("electronics")
nauvis_recipe:assign({
localised_name = { "entity-name.aai-wood-loader" },
icons = table.assign(
table.deepcopy(data.raw.item["aai-wood-loader"].icons),
{ { icon = "__base__/graphics/icons/electronic-circuit.png", scale = 0.25, shift = { 8, 8 } } }
)
})
nauvis_recipe:apply()
end
if mods["aai-loaders-sane"] then
Technology:new("wood-logistics"):addRecipe("aai-wood-loader")
data.raw.technology["aai-wood-loader"] = nil
end

View file

@ -0,0 +1,67 @@
-- Lignumis + Alien Biomes Compatibility - Final Fixes
--
-- This runs AFTER alien-biomes data-updates.lua to ensure our fixes aren't overridden
-- Load order: data.lua -> data-updates.lua -> data-final-fixes.lua (THIS FILE)
if not mods["alien-biomes"] then
return
end
-- Define Lignumis grass tiles (from mapgen.lua)
local lignumis_grass_tiles = {
"grass-1",
"grass-2",
"grass-3",
"grass-4",
"natural-gold-soil"
}
-- Fix tree plant for manual planting on Lignumis grass tiles
local tree_plant = data.raw.plant["tree-plant"]
if mods["Diversitree"] then
tree_plant = data.raw.plant["s6xdvt-fake-tree"]
end
if tree_plant then
for _, tile in pairs(lignumis_grass_tiles) do
local already_present = false
for _, existing_tile in pairs(tree_plant.autoplace.tile_restriction) do
if existing_tile == tile then
already_present = true
break
end
end
if not already_present then
table.insert(tree_plant.autoplace.tile_restriction, tile)
end
end
end
-- Fix tree autoplace restrictions for natural tree spawning
for _, tree in pairs(data.raw.tree) do
if tree.autoplace and tree.autoplace.tile_restriction then
-- Skip gold stromatolites - they should remain exclusive to natural-gold-soil
local is_gold_stromatolite = tree.name and (tree.name:find("stromatolite") or tree.name:find("gold"))
if not is_gold_stromatolite then
-- Check if Lignumis grass tiles are missing
local has_lignumis_tiles = false
for _, existing_tile in pairs(tree.autoplace.tile_restriction) do
for _, lignumis_tile in pairs(lignumis_grass_tiles) do
if existing_tile == lignumis_tile then
has_lignumis_tiles = true
break
end
end
if has_lignumis_tiles then break end
end
-- Add Lignumis grass tiles if missing
if not has_lignumis_tiles then
for _, tile_name in pairs(lignumis_grass_tiles) do
table.insert(tree.autoplace.tile_restriction, tile_name)
end
end
end
end
end

View file

@ -0,0 +1,17 @@
if not mods["alien-biomes"] then return end
local settings = data.raw.planet["lignumis"]["map_gen_settings"].autoplace_settings["decorative"].settings
settings["medium-rock"] = nil
settings["small-rock"] = nil
settings["tiny-rock"] = nil
-- Fix trees not being plantable on Alien Biomes tiles
-- Note: Additional tree fixes for Lignumis grass tiles are handled in alien-biomes-final.lua
local tile_restriction = data.raw["plant"]["tree-plant"].autoplace.tile_restriction
for _, tile in pairs(alien_biomes.all_tiles()) do
if tile.tags and (table.contains(tile.tags, "dirt") or table.contains(tile.tags, "grass")) then
if not table.contains(tile_restriction, tile.name) then
table.insert(tile_restriction, tile.name)
end
end
end

View file

@ -0,0 +1,95 @@
local Technology = require("__cf-lib__/data/Technology")
if not mods["any-planet-start"] then return end
local target_planet = settings.startup["aps-planet"].value
if not target_planet or target_planet == "none" or target_planet == "nauvis" then return end
Technology:new("tree-seeding"):setPrerequisites({ "wood-science-pack" })
-- Switch planet discovery technology to the new planet
local planet_discovery = data.raw.technology["planet-discovery-" .. target_planet] or data.raw.technology["moon-discovery-" .. target_planet]
if planet_discovery then
Technology:new(planet_discovery)
:assign({
enabled = true,
hidden = false,
unit = {
count = 100,
ingredients = {
{ "wood-science-pack", 1 },
{ "steam-science-pack", 1 }
},
time = 30
}
})
:setPrerequisites({ "provisional-rocketry" })
Technology:new("iron-processing"):replacePrerequisite("planet-discovery-nauvis", planet_discovery.name)
Technology:new("copper-processing"):replacePrerequisite("planet-discovery-nauvis", planet_discovery.name)
end
-- Vulcanus
if target_planet == "vulcanus" then
Technology:new("automation"):addPrerequisite("iron-processing")
Technology:new("steel-processing"):addPrerequisite("iron-processing")
Technology:new("tungsten-carbide"):addPrerequisite("planet-discovery-vulcanus")
Technology:new("iron-processing").prototype.research_trigger.entity = "big-volcanic-rock"
Technology:new("copper-processing").prototype.research_trigger.entity = "big-volcanic-rock"
data.raw.resource["tungsten-ore"].category = "basic-solid"
if mods["bztitanium"] and mods["crushing-industry"] then
Technology:new("foundry"):addRecipe("crushed-titanium-ore")
data.raw.recipe["crushed-titanium-ore"].category = "basic-crushing"
end
if mods["bzcarbon"] then
Technology:new("graphite-processing"):addPrerequisite("planet-discovery-vulcanus")
Technology:new("diamond-processing-2"):addPrerequisite("planet-discovery-vulcanus")
end
if mods["bzsilicon"] then
Technology:new("silica-processing"):addPrerequisite("planet-discovery-vulcanus")
end
if mods["bzzirconium"] then
Technology:new("zirconia-processing"):addPrerequisite("planet-discovery-vulcanus")
end
end
-- Fulgora
if target_planet == "fulgora" then
data.raw.recipe["medium-electric-pole"].enabled = false
Technology:new("recycling")
:addPrerequisite("planet-discovery-fulgora")
:addRecipe("medium-electric-pole")
Technology:new("iron-processing").prototype.research_trigger.entity = "scrap"
Technology:new("copper-processing").prototype.research_trigger.entity = "scrap"
if mods["fulgora-coralmium-agriculture"] then
Technology:new("coralmium-recycling")
:addPrerequisite("recycling")
:removeRecipe("agricultural-tower")
end
end
-- Gleba
if target_planet == "gleba" then
Technology:new("landfill")
:setPrerequisites({ "burner-automation" })
:assign({
unit = {
count = 50,
ingredients = { { "wood-science-pack", 1 } },
time = 15
}
})
.prototype.research_trigger = nil
Technology:new("iron-processing").prototype.research_trigger.entity = "iron-stromatolite"
Technology:new("copper-processing").prototype.research_trigger.entity = "copper-stromatolite"
end

View file

@ -0,0 +1,10 @@
local Technology = require("__cf-lib__/data/Technology")
if not mods["crushing-industry"] then return end
if not settings.startup["crushing-industry-ore"].value then return end
if mods["aai-industry"] then
Technology:new("burner-mechanics"):removeRecipe("burner-crusher")
else
Technology:new("steam-power"):removeRecipe("burner-crusher")
end

View file

@ -0,0 +1,112 @@
local item_sounds = require("__base__.prototypes.item_sounds")
local Recipe = require("__cf-lib__/data/Recipe")
if not mods["crushing-industry"] then return end
if not settings.startup["crushing-industry-ore"].value then return end
data:extend({
{
type = "item",
name = "crushed-gold-ore",
icon = Lignumis.graphics .. "icons/crushed-gold-ore.png",
pictures = {
{ size = 64, filename = Lignumis.graphics .. "icons/crushed-gold-ore.png", scale = 0.5, mipmap_count = 4 },
{ size = 64, filename = Lignumis.graphics .. "icons/crushed-gold-ore-1.png", scale = 0.5, mipmap_count = 4 },
{ size = 64, filename = Lignumis.graphics .. "icons/crushed-gold-ore-2.png", scale = 0.5, mipmap_count = 4 },
},
subgroup = "raw-resource",
color_hint = { text = "C" },
order = "f[gold-ore]-c[crushed]",
inventory_move_sound = item_sounds.resource_inventory_move,
pick_sound = item_sounds.resource_inventory_pickup,
drop_sound = item_sounds.resource_inventory_move,
stack_size = 100,
weight = 2 * kg
},
{
type = "recipe",
name = "crushed-gold-ore",
localised_name = { "recipe-name.gold-ore-crushing" },
icons = CrushingIndustry.make_crushing_icons("gold-ore"),
category = "basic-crushing",
enabled = false,
allow_productivity = true,
auto_recycle = false,
energy_required = 1.2,
ingredients = { { type = "item", name = "gold-ore", amount = 1 } },
results = { { type = "item", name = "crushed-gold-ore", amount = 1, extra_count_fraction = 0.5 } },
main_product = "crushed-gold-ore"
},
{
type = "recipe",
name = "crushed-gold-smelting",
localised_name = { "recipe-name.crushed-smelting", { "item-name.gold-plate" } },
icons = {
{ icon = Lignumis.graphics .. "icons/crushed-gold-ore.png", shift = { -12, -12 }, scale = 0.4 },
{ icon = Lignumis.graphics .. "icons/gold-plate.png", draw_background = true }
},
category = "smelting",
order = "a[smelting]-b[gold-plate]-c[crushed]",
enabled = false,
allow_productivity = true,
auto_recycle = false,
hide_from_player_crafting = settings.startup["crushing-industry-hide-player-crafting"].value,
energy_required = 3.2,
ingredients = { { type = "item", name = "crushed-gold-ore", amount = 1 } },
results = { { type = "item", name = "gold-plate", amount = 1 } },
main_product = "gold-plate",
},
{
type = "technology",
name = "basic-ore-crushing",
icon = Lignumis.graphics .. "technology/basic-ore-crushing.png",
icon_size = 256,
effects = {
{ type = "unlock-recipe", recipe = "burner-crusher" },
{ type = "unlock-recipe", recipe = "crushed-gold-ore" },
{ type = "unlock-recipe", recipe = "crushed-gold-smelting" }
},
prerequisites = { "steam-science-pack" },
unit = {
count = 100,
ingredients = {
{ "wood-science-pack", 1 },
{ "steam-science-pack", 1 }
},
time = 15
}
}
})
Recipe:new("molten-gold"):replaceIngredient("gold-ore", "crushed-gold-ore", 75)
if settings.startup["crushing-industry-byproducts"].value then
table.insert(data.raw["recipe"]["crushed-gold-ore"].results,
{ type = "item", name = "gold-ore", amount = 1, probability = 0.05 })
table.insert(data.raw["recipe"]["crushed-gold-ore"].results,
{ type = "item", name = "moist-stromatolite-remnant", amount = 1, probability = 0.02 })
end
local gold_recipe = Recipe:new("burner-crusher")
:replaceIngredient("iron-gear-wheel", "wooden-gear-wheel")
:replaceIngredient("iron-plate", "gold-plate")
:assign({
category = settings.startup["lignumis-lumber-mill-more-recipes"].value and "wood-processing-or-assembling" or
"crafting"
})
gold_recipe:clone("burner-crusher-copper")
:replaceIngredient("gold-plate", "copper-plate")
:assign({
localised_name = { "entity-name.burner-crusher" },
icons = {
{ icon = data.raw.item["burner-crusher"].icon },
{ icon = "__base__/graphics/icons/copper-plate.png", scale = 0.25, shift = { 8, 8 } }
}
})
:unlockedByTechnology("copper-processing")
:apply()
if mods["aai-industry"] then
gold_recipe:replaceIngredient("motor", "wooden-gear-wheel")
end

View file

@ -0,0 +1,9 @@
require("hot-metals")
require("wood-military")
require("metal-and-stars")
require("alien-biomes")
require("aai-loaders")
require("nuclear-science")
require("lane-splitters")
require("wood-industry")
require("crushing-industry")

View file

@ -0,0 +1,7 @@
require("aai-loaders-final")
require("any-planet-start-final")
require("alien-biomes-final")
if not data.raw.technology["legendary-quality"] then
table.removeValue(data.raw.technology["quality-assembler"].prerequisites, "legendary-quality")
end

View file

@ -0,0 +1,16 @@
local Technology = require("__cf-lib__/data/Technology")
if not mods["gleba-reborn"] then return end
Technology:new("tree-seeding")
:setPrerequisites({ "wood-science-pack" })
:assign({
unit = {
count = 10,
ingredients = {
{ "wood-science-pack", 1 }
},
time = 10
}
})
.prototype.research_trigger = nil

View file

@ -0,0 +1,3 @@
if not mods["hot-metals"] then return end
table.insert(HotMetals.items, { name = "gold-plate", iconFolder = Lignumis.graphics .. "icons/" })

View file

@ -0,0 +1,44 @@
local Technology = require("__cf-lib__/data/Technology")
if not mods["Krastorio2-spaced-out"] then return end
data.raw.recipe["burner-inserter"].ingredients = {
{ type = "item", name = "wooden-gear-wheel", amount = 1 },
{ type = "item", name = "lumber", amount = 1 }
}
Technology:new("kr-automation-core"):addPrerequisite("iron-processing")
local function lock_recipes(technology, recipes)
local tech = Technology:new(technology)
for _, recipe in pairs(recipes) do
tech:addRecipe(recipe)
data.raw.recipe[recipe].enabled = false
end
end
lock_recipes("iron-processing", {
"iron-stick",
"kr-wind-turbine",
"kr-iron-beam",
"kr-inserter-parts"
})
lock_recipes("copper-processing", {
"copper-cable",
"small-electric-pole"
})
lock_recipes("planet-discovery-nauvis", {
"kr-rare-metals"
})
Technology:new("electronics"):removeRecipe("kr-electronic-circuit-wood")
if settings.startup["kr-realistic-weapons"].value then
local pistol_attack = data.raw.gun["pistol"].attack_parameters
pistol_attack.ammo_categories = pistol_attack.ammo_categories or { pistol_attack.ammo_category }
pistol_attack.ammo_category = nil
table.insert(pistol_attack.ammo_categories, "bullet")
data.raw.recipe["firearm-magazine"].enabled = false
end

View file

@ -0,0 +1,38 @@
local Recipe = require("__cf-lib__/data/Recipe")
local Technology = require("__cf-lib__/data/Technology")
if not mods["lane-splitters"] then return end
local lane_splitter = make_tier({
name = "wood-lane-splitter",
base_belt = "wood-transport-belt",
base_splitter = "wood-splitter",
health = 150,
next_upgrade = "lane-splitter",
})
lane_splitter.prototype.icon = Lignumis.graphics .. "icons/wood-lane-splitter.png"
lane_splitter.prototype.dying_explosion = "transport-belt-explosion"
lane_splitter.prototype.structure.east.filename = data.raw.splitter["wood-splitter"].structure.east.filename
lane_splitter.prototype.structure.south.filename = data.raw.splitter["wood-splitter"].structure.south.filename
lane_splitter.prototype.structure.west.filename = data.raw.splitter["wood-splitter"].structure.west.filename
lane_splitter.prototype.structure.north.filename = data.raw.splitter["wood-splitter"].structure.north.filename
lane_splitter.prototype.structure_patch.east.filename = data.raw.splitter["wood-splitter"].structure_patch.east.filename
lane_splitter.prototype.structure_patch.south.filename = data.raw.splitter["wood-splitter"].structure_patch.south.filename
lane_splitter.prototype.structure_patch.west.filename = data.raw.splitter["wood-splitter"].structure_patch.west.filename
lane_splitter.prototype.structure_patch.north.filename = data.raw.splitter["wood-splitter"].structure_patch.north.filename
lane_splitter.item.icon = Lignumis.graphics .. "icons/wood-lane-splitter.png"
lane_splitter.item.order = "d[lane-splitter]-0[wood-lane-splitter]"
lane_splitter.recipe.category = "wood-processing-or-assembling"
data:extend({
lane_splitter.prototype,
lane_splitter.item,
lane_splitter.recipe,
})
Technology:new("wood-logistics"):addRecipe("wood-lane-splitter")
if mods["aai-industry"] and settings.startup["lignumis-basic-circuit-board"].value then
Recipe:new("lane-splitter"):replaceIngredient("electronic-circuit", "basic-circuit-board")
end

View file

@ -0,0 +1,6 @@
if not mods["metal-and-stars"] then return end
data.raw.recipe["gold-plate"].enabled = true
data.raw.recipe["gold-cable"].enabled = true
data.raw.item["gold-plate"].icon = Lignumis.graphics .. "icons/gold-plate.png"

View file

@ -0,0 +1,4 @@
if not mods["atan-nuclear-science"] then return end
table.insert(data.raw["assembling-machine"]["burner-assembling-machine"].crafting_categories, "advanced-centrifuging-or-crafting")
table.insert(data.raw["assembling-machine"]["steam-assembling-machine"].crafting_categories, "advanced-centrifuging-or-crafting")

View file

@ -0,0 +1,4 @@
require("aai-industry")
require("gleba-reborn")
require("crushing-industry-updates")
require("k2so")

View file

@ -0,0 +1,3 @@
if not mods["wood-industry"] then return end
data.raw.item["woodchips"].fuel_category = "wood"

View file

@ -0,0 +1,3 @@
if not mods["wood-military"] then return end
data.raw.armor["wood-armor"].equipment_grid = "tiny-equipment-grid"