lumber mill

This commit is contained in:
Simon Brodtmann 2025-12-12 18:35:27 +01:00
parent df9b72e4fa
commit 08327e5269

View file

@ -1,3 +1,4 @@
local Recipe = require("__cf-lib__/data/Recipe")
local Technology = require("__cf-lib__/data/Technology")
local LumberMillFactory = require(MF.buildings .. "LumberMill")
local LumberMill = LumberMillFactory()
@ -13,7 +14,8 @@ data:extend({
local has_oxygen = data.raw["surface-property"]["oxygen"] ~= nil
LumberMill.EntityBuilder:new()
if not mods["wood-logistics"] then
LumberMill.EntityBuilder:new()
:burnerEnergySource({ emissions_per_minute = { noise = 100 } })
:baseProductivity(0.5)
:apply({
@ -32,13 +34,13 @@ LumberMill.EntityBuilder:new()
}
})
local lumber_mill_item = LumberMill.ItemBuilder:new()
local lumber_mill_item = LumberMill.ItemBuilder:new()
:apply({
default_import_location = "lignumis",
order = "2[lumber-mill]"
})
LumberMill.RecipeBuilder:new()
LumberMill.RecipeBuilder:new()
:ingredients(table.trim({
{ type = "item", name = "stone-brick", amount = 40 },
{ type = "item", name = "lumber", amount = 50 },
@ -51,14 +53,14 @@ LumberMill.RecipeBuilder:new()
additional_categories = { "wood-processing" }
})
LumberMill.TechnologyBuilder:new()
LumberMill.TechnologyBuilder:new()
:prerequisites({ "steam-science-pack" })
:count(250)
:time(15)
:ingredients({ { "wood-science-pack", 1 }, { "steam-science-pack", 1 } })
:apply()
LumberMill.RecipeBuilder:new()
LumberMill.RecipeBuilder:new()
:ingredients({
{ type = "item", name = "stone-brick", amount = 40 },
{ type = "item", name = "lumber", amount = 50 },
@ -77,4 +79,72 @@ LumberMill.RecipeBuilder:new()
}
})
Technology:new(basic_circuit_board and "copper-processing" or "electronics"):addRecipe("lumber-mill-copper")
Technology:new(basic_circuit_board and "copper-processing" or "electronics"):addRecipe("lumber-mill-copper")
else
table.assign(data.raw["assembling-machine"]["lumber-mill"], {
energy_source = {
type = "burner",
fuel_categories = { "chemical" },
effectivity = 1,
fuel_inventory_size = 3,
emissions_per_minute = { pollution = 10, noise = 100 },
},
crafting_categories = { "wood-processing" },
energy_usage = "1000kW",
module_slots = 4,
max_health = 500,
surface_conditions = {
{
property = has_oxygen and "oxygen" or "pressure",
min = 3
},
{
property = "gravity",
min = 1
}
}
})
data.raw.item["lumber-mill"].default_import_location = "lignumis"
table.assign(data.raw.recipe["lumber-mill"], {
additional_categories = { "wood-processing" },
ingredients = table.trim({
{ type = "item", name = "stone-brick", amount = 40 },
{ type = "item", name = "lumber", amount = 50 },
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
{ type = "item", name = "gold-plate", amount = basic_circuit_board and 20 or 40 },
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 20 } or nil,
{ type = "item", name = "burner-assembling-machine", amount = 2 }
})
})
table.assign(data.raw.technology["advanced-carpentry"], {
prerequisites = { "steam-science-pack" },
unit = {
count = 250,
time = 15,
ingredients = {
{ "wood-science-pack", 1 },
{ "steam-science-pack", 1 }
}
}
})
Recipe:new("lumber-mill")
:clone("lumber-mill-copper")
:assign({
localised_name = { "entity-name.lumber-mill" },
icons = {
{ icon = data.raw.item["lumber-mill"].icon },
{ icon = basic_circuit_board and "__base__/graphics/icons/copper-plate.png" or "__base__/graphics/icons/electronic-circuit.png", scale = 0.25, shift = { 8, 8 } }
}
})
:replaceIngredient("gold-plate", "copper-plate")
:apply()
Technology:new(basic_circuit_board and "copper-processing" or "electronics"):addRecipe("lumber-mill-copper")
end
Recipe:new("wooden-chest"):addCategory("wood-processing")
Recipe:new("small-electric-pole"):addCategory("wood-processing")