For my mod i want an inserter that does not require power but can only be used for a specific resource.
I have solved the power issue by making it a burner and automatically filling its burner inventory with 1 gazillion Joule when placed.
However, i don`t want the player to be able to abuse the inserter for any item.
So, Is there anyway i can enforce the filter on the inserter?
Disable user from changing inserter filter
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Disable user from changing inserter filter
You can set it to LuaEntity.operable = false on creation, preventing the player from opening the GUI. You also have to remove the fast-replaceable group to prevent blueprints from setting a filter on it (hopefully that it sufficient :p).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Disable user from changing inserter filter
I just managed to do a quick " on_gui_opened => player.opened=nil"
But yeah "operable = false" makes a lot more sense x)
Totally forgot about the blueprints... Nice catch!
But yeah "operable = false" makes a lot more sense x)
Totally forgot about the blueprints... Nice catch!