The EntryRegistry
holds the list of entries.
In a client plugin (Constructing Plugins), override registerEntries
, from here, you may modify the entries.
You are recommended to only add / remove entries during plugin reload (When your registerEntries
method is called), as it may mess with REI's filtering rules system.
Some methods allow you to specify where you want to add your entries after, which is useful if you are to add variants to your entry. However, for items, it is best to override Item#appendStacks
for REI to automatically add your variants. (Plus, your variants will be properly displayed in the creative menu!)
<aside>
💡 Visit the source code of EntryRegistry
, the JavaDocs should explain what each method does.
</aside>
You can only get the unmodifiable view of the entries. You are advised to not use these methods if possible.
/**
* @return the size of entry stacks, before being filtered by filtering rules.
*/
int size();
/**
* @return the unmodifiable stream of entry stacks, before being filtered by filtering rules.
*/
Stream<EntryStack<?>> getEntryStacks();
/**
* @return the unmodifiable list of filtered entry stacks,
* only available <b>after</b> plugins reload.
*/
List<EntryStack<?>> getPreFilteredList();