mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-31 04:11:39 +09:00
.
This commit is contained in:
@@ -8,6 +8,7 @@ if settings.startup['PHI-CT'].value then
|
|||||||
if not (entity and entity.valid) then
|
if not (entity and entity.valid) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if entity.name == 'trash-chest' then
|
if entity.name == 'trash-chest' then
|
||||||
entity.infinity_container_filters = {}
|
entity.infinity_container_filters = {}
|
||||||
entity.remove_unfiltered_items = true
|
entity.remove_unfiltered_items = true
|
||||||
@@ -17,19 +18,6 @@ if settings.startup['PHI-CT'].value then
|
|||||||
end
|
end
|
||||||
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_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.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)
|
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_enabled, hidden_recipe_enable)
|
||||||
script.on_event(defines.events.on_player_cheat_mode_disabled, 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 = {}
|
local gui = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user