From b28eb0e4fda3434a3db9b47c07558fd6888983d0 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Thu, 27 Mar 2025 19:38:25 +0900 Subject: [PATCH] . --- PHI-CL/control.lua | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/PHI-CL/control.lua b/PHI-CL/control.lua index ad382ef..13aceac 100644 --- a/PHI-CL/control.lua +++ b/PHI-CL/control.lua @@ -8,6 +8,7 @@ if settings.startup['PHI-CT'].value then if not (entity and entity.valid) then return end + if entity.name == 'trash-chest' then entity.infinity_container_filters = {} entity.remove_unfiltered_items = true @@ -17,19 +18,6 @@ if settings.startup['PHI-CT'].value then end end - local function trash_check() - for _, surface in pairs(game.surfaces) do - for _, e in pairs(surface.find_entities_filtered{name='trash-chest'}) do - e.infinity_container_filters = {} - e.remove_unfiltered_items = true - end - - for _, e in pairs(surface.find_entities_filtered{name='trash-pipe'}) do - e.set_infinity_pipe_filter(nil) - end - end - end - script.on_event(defines.events.on_built_entity, trash_creation, {{filter='name', name='trash-chest', mode='or'}, {filter='name', name='trash-pipe', mode='or'}}) script.on_event(defines.events.on_robot_built_entity, trash_creation, {{filter='name', name='trash-chest', mode='or'}, {filter='name', name='trash-pipe', mode='or'}}) script.on_event(defines.events.script_raised_built, trash_creation) @@ -53,7 +41,18 @@ if settings.startup['PHI-CT'].value then script.on_event(defines.events.on_player_cheat_mode_enabled, hidden_recipe_enable) script.on_event(defines.events.on_player_cheat_mode_disabled, hidden_recipe_enable) - script.on_init(trash_check) + script.on_init(function(_) + for _, surface in pairs(game.surfaces) do + for _, e in pairs(surface.find_entities_filtered{name='trash-chest'}) do + e.infinity_container_filters = {} + e.remove_unfiltered_items = true + end + + for _, e in pairs(surface.find_entities_filtered{name='trash-pipe'}) do + e.set_infinity_pipe_filter(nil) + end + end + end) --[[ local gui = {}