RegistryOpsMixin

public class RegistryOpsMixin

This Mixin hooks int the creation of RegistryOps, which will currently load data pack contents into the supplied dynamic registry manager, making it the point at which we should apply biome modifications.

There is generally the following order:

  1. create is used to create a dynamic registry manager with just entries from net.minecraft.util.registry.BuiltinRegistries
  2. Sometimes, Vanilla Minecraft will stop here, and use the DynamicRegistryManager as-is (examples: server.properties parsing, world creation screen).
  3. of gets called with the manager, and a resource manager that contains the loaded data packs. This will pull in all worldgen objects from datapacks into the dynamic registry manager.
  4. After the worldgen objects are pulled in from the datapacks, this mixin will call the biome modification callback.
  5. In most cases, Vanilla will stop here and now use the dynamic registy manager to instantiate a server.
  6. Sometimes, i.e. when using the "re-create world feature", and a datapack throws an error, Vanilla will sometimes repeat the of call on the same dynamic registry manager. We guard against this using net.fabricmc.fabric.impl.biome.modification.BiomeModificationTracker.

Sources

jvm source
Link copied to clipboard