1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

Add module to remove non stacke recipes.

This commit is contained in:
James Gillham 2021-12-12 16:29:31 +00:00
parent 8e07f96b32
commit e9228b72a5
5 changed files with 53 additions and 148 deletions

View File

@ -0,0 +1,41 @@
-- This module removes the non ore stacking recipes used by deadlock's beltboxes.
local Event = require 'utils.event'
return function()
local allowed_recipes = {
["deadlock-stacks-stack-iron-ore"] = true,
["deadlock-stacks-unstack-iron-ore"] = true,
["deadlock-stacks-stack-copper-ore"] = true,
["deadlock-stacks-unstack-copper-ore"] = true,
["deadlock-stacks-stack-stone"] = true,
["deadlock-stacks-unstack-stone"] = true,
["deadlock-stacks-stack-coal"] = true,
["deadlock-stacks-unstack-coal"] = true,
["deadlock-stacks-stack-uranium-ore"] = true,
["deadlock-stacks-unstack-uranium-ore"] = true
}
Event.add(defines.events.on_research_finished, function(event)
local research = event.research
if not research.valid then
return
end
for _, effect in pairs(research.effects) do
if effect.type ~= 'unlock-recipe' then
goto continue
end
local name = effect.recipe
if allowed_recipes[name] then
goto continue
end
if name:sub(1, #'deadlock-stacks') == 'deadlock-stacks' then
game.forces.player.recipes[name].enabled = false
end
::continue::
end
end)
end

View File

@ -109,43 +109,6 @@ Event.on_init(function()
RS.get_surface().peaceful_mode = true
end)
local allowed_recipes = {
["deadlock-stacks-stack-iron-ore"] = true,
["deadlock-stacks-unstack-iron-ore"] = true,
["deadlock-stacks-stack-copper-ore"] = true,
["deadlock-stacks-unstack-copper-ore"] = true,
["deadlock-stacks-stack-stone"] = true,
["deadlock-stacks-unstack-stone"] = true,
["deadlock-stacks-stack-coal"] = true,
["deadlock-stacks-unstack-coal"] = true,
["deadlock-stacks-stack-uranium-ore"] = true,
["deadlock-stacks-unstack-uranium-ore"] = true
}
Event.add(defines.events.on_research_finished, function(event)
local research = event.research
if not research.valid then
return
end
for _, effect in pairs(research.effects) do
if effect.type ~= 'unlock-recipe' then
goto continue
end
local name = effect.recipe
if allowed_recipes[name] then
goto continue
end
if name:sub(1, #'deadlock-stacks') == 'deadlock-stacks' then
game.forces.player.recipes[name].enabled = false
end
::continue::
end
end)
local terraforming = require 'map_gen.maps.danger_ores.modules.terraforming'
terraforming({start_size = 8 * 32, min_pollution = 400, max_pollution = 16000, pollution_increment = 6})
@ -161,6 +124,9 @@ container_dump({entity_name = 'coal'})
local concrete_on_landfill = require 'map_gen.maps.danger_ores.modules.concrete_on_landfill'
concrete_on_landfill({tile = 'blue-refined-concrete'})
local remove_non_ore_stacked_recipes = require 'map_gen.maps.danger_ores.modules.remove_non_ore_stacked_recipes'
remove_non_ore_stacked_recipes()
local config = {
spawn_shape = b.circle(36),
start_ore_shape = b.circle(44),

View File

@ -107,43 +107,6 @@ Event.on_init(function()
RS.get_surface().peaceful_mode = true
end)
local allowed_recipes = {
["deadlock-stacks-stack-iron-ore"] = true,
["deadlock-stacks-unstack-iron-ore"] = true,
["deadlock-stacks-stack-copper-ore"] = true,
["deadlock-stacks-unstack-copper-ore"] = true,
["deadlock-stacks-stack-stone"] = true,
["deadlock-stacks-unstack-stone"] = true,
["deadlock-stacks-stack-coal"] = true,
["deadlock-stacks-unstack-coal"] = true,
["deadlock-stacks-stack-uranium-ore"] = true,
["deadlock-stacks-unstack-uranium-ore"] = true
}
Event.add(defines.events.on_research_finished, function(event)
local research = event.research
if not research.valid then
return
end
for _, effect in pairs(research.effects) do
if effect.type ~= 'unlock-recipe' then
goto continue
end
local name = effect.recipe
if allowed_recipes[name] then
goto continue
end
if name:sub(1, #'deadlock-stacks') == 'deadlock-stacks' then
game.forces.player.recipes[name].enabled = false
end
::continue::
end
end)
local terraforming = require 'map_gen.maps.danger_ores.modules.terraforming'
terraforming({start_size = 8 * 32, min_pollution = 400, max_pollution = 16000, pollution_increment = 6})
@ -159,6 +122,9 @@ container_dump({entity_name = 'coal'})
local concrete_on_landfill = require 'map_gen.maps.danger_ores.modules.concrete_on_landfill'
concrete_on_landfill({tile = 'blue-refined-concrete'})
local remove_non_ore_stacked_recipes = require 'map_gen.maps.danger_ores.modules.remove_non_ore_stacked_recipes'
remove_non_ore_stacked_recipes()
local main_ores_builder = require 'map_gen.maps.danger_ores.modules.main_ores_gradient'
local config = {

View File

@ -114,43 +114,6 @@ Event.on_init(
end
)
local allowed_recipes = {
["deadlock-stacks-stack-iron-ore"] = true,
["deadlock-stacks-unstack-iron-ore"] = true,
["deadlock-stacks-stack-copper-ore"] = true,
["deadlock-stacks-unstack-copper-ore"] = true,
["deadlock-stacks-stack-stone"] = true,
["deadlock-stacks-unstack-stone"] = true,
["deadlock-stacks-stack-coal"] = true,
["deadlock-stacks-unstack-coal"] = true,
["deadlock-stacks-stack-uranium-ore"] = true,
["deadlock-stacks-unstack-uranium-ore"] = true
}
Event.add(defines.events.on_research_finished, function(event)
local research = event.research
if not research.valid then
return
end
for _, effect in pairs(research.effects) do
if effect.type ~= 'unlock-recipe' then
goto continue
end
local name = effect.recipe
if allowed_recipes[name] then
goto continue
end
if name:sub(1, #'deadlock-stacks') == 'deadlock-stacks' then
game.forces.player.recipes[name].enabled = false
end
::continue::
end
end)
local terraforming = require 'map_gen.maps.danger_ores.modules.terraforming'
terraforming({start_size = 8 * 32, min_pollution = 400, max_pollution = 16000, pollution_increment = 6})
@ -166,6 +129,9 @@ container_dump({entity_name = 'coal'})
local concrete_on_landfill = require 'map_gen.maps.danger_ores.modules.concrete_on_landfill'
concrete_on_landfill({tile = 'blue-refined-concrete'})
local remove_non_ore_stacked_recipes = require 'map_gen.maps.danger_ores.modules.remove_non_ore_stacked_recipes'
remove_non_ore_stacked_recipes()
local main_ores_builder = require 'map_gen.maps.danger_ores.modules.main_ores_hub_spiral'
local sqrt = math.sqrt

View File

@ -118,43 +118,6 @@ Event.on_init(
end
)
local allowed_recipes = {
["deadlock-stacks-stack-iron-ore"] = true,
["deadlock-stacks-unstack-iron-ore"] = true,
["deadlock-stacks-stack-copper-ore"] = true,
["deadlock-stacks-unstack-copper-ore"] = true,
["deadlock-stacks-stack-stone"] = true,
["deadlock-stacks-unstack-stone"] = true,
["deadlock-stacks-stack-coal"] = true,
["deadlock-stacks-unstack-coal"] = true,
["deadlock-stacks-stack-uranium-ore"] = true,
["deadlock-stacks-unstack-uranium-ore"] = true
}
Event.add(defines.events.on_research_finished, function(event)
local research = event.research
if not research.valid then
return
end
for _, effect in pairs(research.effects) do
if effect.type ~= 'unlock-recipe' then
goto continue
end
local name = effect.recipe
if allowed_recipes[name] then
goto continue
end
if name:sub(1, #'deadlock-stacks') == 'deadlock-stacks' then
game.forces.player.recipes[name].enabled = false
end
::continue::
end
end)
local terraforming = require 'map_gen.maps.danger_ores.modules.terraforming'
terraforming({start_size = 12 * 32, min_pollution = 250, max_pollution = 16000, pollution_increment = 6})
@ -170,6 +133,9 @@ container_dump({entity_name = 'coal'})
local concrete_on_landfill = require 'map_gen.maps.danger_ores.modules.concrete_on_landfill'
concrete_on_landfill({tile = 'blue-refined-concrete'})
local remove_non_ore_stacked_recipes = require 'map_gen.maps.danger_ores.modules.remove_non_ore_stacked_recipes'
remove_non_ore_stacked_recipes()
local main_ores_builder = require 'map_gen.maps.danger_ores.modules.main_ores_xmas_tree'
--local sqrt = math.sqrt