GeyserMC / Geyser

A bridge/proxy allowing you to connect to Minecraft: Java Edition servers with Minecraft: Bedrock Edition.
https://geysermc.org
MIT License
4.75k stars 687 forks source link

Use deferred where needed instead of a load method on all registries #5112

Closed Tim203 closed 3 weeks ago

Tim203 commented 3 weeks ago

Should fix an issue where the providers registry is called before the load method was called. Instead of having a load method on all registries, only have a load method on registries that need it (e.g. ones loading resource files).

You probably noticed that a few new DeferredRegistry classes were added. This is because while DeferredRegistry technically works with any registry type, almost every (if not all) implementations of Registry have their own methods. A good example would be VersionedRegistry. Having a DeferredRegistry class for each type allows you to use the deferred variant identically to the non-deferred variant.