diff --git a/config/module.lua b/config/module.lua index cb776990..a519398b 100644 --- a/config/module.lua +++ b/config/module.lua @@ -5,6 +5,15 @@ return { machine_prod_disallow = { ['beacon'] = true }, + machine_craft = { + ['assembling-machine-2'] = true, + ['assembling-machine-3'] = true, + ['electric-furnace'] = true, + ['oil-refinery'] = true, + ['chemical-plant'] = true, + ['centrifuge'] = true, + ['rocket-silo'] = true + }, machine = { ['electric-mining-drill'] = 'effectivity-module', ['assembling-machine-2'] = 'productivity-module', diff --git a/modules/gui/module.lua b/modules/gui/module.lua index 760ea015..1afdef3d 100644 --- a/modules/gui/module.lua +++ b/modules/gui/module.lua @@ -123,15 +123,22 @@ end local function apply_module(player, area, machine, module) for _, entity in pairs(player.surface.find_entities_filtered{area=area, name=machine, force=player.force}) do - local m_current_recipe = entity.get_recipe() + if config.machine_craft[machine] ~= nil then + if config.machine_craft[machine] then + local m_current_recipe = entity.get_recipe() - -- insert - if m_current_recipe ~= nil then - if module_allowed[m_current_recipe.name] ~= nil then - if module_allowed[m_current_recipe.name] then + if m_current_recipe ~= nil then + if module_allowed[m_current_recipe.name] ~= nil then + if module_allowed[m_current_recipe.name] then + entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=module} + end + end + + else entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=module} end end + else entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=module} end