[Feature] Add `getEntries()` method to `DeferredRegister`
moritz-htk opened this issue ยท 1 comments
I propose adding a getEntries() method to the DeferredRegister class. This method would allow retrieving all entries from the DeferredRegister at once instead of calling each one individually.
Add the following method to the DeferredRegister class:
public Collection<RegistrySupplier<T>> getEntries() {
return entryView;
}With this method, it would be possible to streamline operations in datagen, for example:
@Override
protected void registerModels() {
MFItems.ITEMS.getEntries().stream().map(RegistrySupplier::get).forEach(this::basicItem);
}Without this method, each entry must be written individually, as shown here:
@Override
protected void registerModels() {
basicItem(...)
basicItem(...)
basicItem(...)
basicItem(...)
basicItem(...)
}I have tested this implementation and it works as intended.