mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2026-07-28 05:26:24 +09:00
.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
local main = {}
|
||||
|
||||
local chest_filter = {}
|
||||
|
||||
do
|
||||
for _, q in pairs(prototypes.quality) do
|
||||
local q_name = q.name
|
||||
local j = 0
|
||||
chest_filter[q_name] = {}
|
||||
|
||||
for _, i in pairs(prototypes.item) do
|
||||
if not i.hidden and not (i.subgroup and i.subgroup == 'parameters') then
|
||||
j = j + 1
|
||||
table.insert(chest_filter[q_name], {index = j, name = i.name, quality = q_name, mode = 'exactly', count = i.stack_size})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function main.build(event)
|
||||
if event.entity.type ~= 'infinity-container' then
|
||||
return
|
||||
end
|
||||
|
||||
if event.entity.name ~= 'super-infinity-chest' then
|
||||
return
|
||||
end
|
||||
|
||||
event.entity.remove_unfiltered_items = true
|
||||
event.entity.infinity_container_filters = chest_filter[event.entity.quality.name]
|
||||
end
|
||||
|
||||
return main
|
||||
Reference in New Issue
Block a user