1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-05 15:05:57 +02:00

Build checks...

This commit is contained in:
Soggs 2021-05-19 18:23:36 +02:00
parent f1106061aa
commit 480de9f27f

View File

@ -13,33 +13,16 @@ end
return function(config)
local main_ores = config.main_ores
local resource_patches = (config.resource_patches or no_op)(config) or b.empty_shape
local dense_patches = (config.dense_patches or no_op)(config) or no_op
local main_ores_split_count = config.main_ores_split_count or 1
local seed = config.seed or seed_provider()
main_ores = Helper.split_ore(main_ores, main_ores_split_count)
local start_ore_shape = config.start_ore_shape or b.circle(68)
local function apply_resource_patches(x,y, world, entity)
local resource_patches_entity = resource_patches(x, y, world)
if resource_patches_entity ~= false then
return resource_patches_entity
end
dense_patches(x, y, entity)
entity.enable_tree_removal = false
return entity
end
local function condition_factory(config, ore_name)
local function condition_factory(ore_name)
return function(x, y, _)
local scale = config.circle_scale or 1
local randomize_scale = config.randomize_scale or false
local ore_table = {}
for _, ore_data in pairs(config.main_ores) do
for _, ore_data in pairs(main_ores) do
table.insert(ore_table, {name = ore_data.name, weight = ore_data.weight})
end
local weighted = b.prepare_weighted_array(ore_table)
@ -51,9 +34,9 @@ return function(config)
return ore_table[index].name == ore_name
end
end
return function(tile_builder, ore_builder, spawn_shape, water_shape, random_gen)
return function(tile_builder, ore_builder, spawn_shape, water_shape, _)
local shapes = {}
for _, ore_data in pairs(main_ores) do
local ore_name = ore_data.name
@ -69,9 +52,9 @@ return function(config)
local shape = b.choose(condition, b.apply_entity(land, ore), b.empty_shape)
table.insert(shapes, shape)
end
local ores = b.any(shapes)
return b.any {spawn_shape, water_shape, ores}
end
end