Maxmani / arcadian-dream

A Touhou mod for modern Minecraft.
https://modrinth.com/mod/arcadian-dream
European Union Public License 1.2
17 stars 8 forks source link

Replace Registries.BLOCK iteration with RegistryEntryAddedCallback usage #22

Open unilock opened 2 months ago

unilock commented 2 months ago

This cuts down world loading time by nearly two minutes in my very large Fabric 1.20.1 modpack.

LEAVES_LOOT_TABLES has to be in a separate class as to not accidentally classload everything. It also includes Minecraft's leaves by default, since the RegistryEntryAddedCallback listener wouldn't pick those up for some reason.

A silly mixin is used in order to make sure the RegistryEntryAddedCallback listener is registered before all other mods are initialized and start registering their blocks. Blame Fabric for not having a reliable mod loading order.

Tested and working.