-
Notifications
You must be signed in to change notification settings - Fork 19
Forge Registries
In forge there are 4 different stages a registries can be in.
- Vanilla
- Frozen
- Staging
- Active
When you boot up the game the Forge sends a signal to all the loaded mods to start register their blocks/potions/GUI/commands args into different registries. It's only during this time mods are allowed to register stuff. After this event has passed, all registries are frozen and can't be modified anymore. They then get copied to the Active stage.
Registries are stored as Forge Snapshots in the levels.dat file in each world.
When a client or server loads a world, the registries stored in the snapshots gets loaded. These registries get put in the Staging stage. It's here the registries are prepared to get loaded into the Active stage. The registries gets validate and checked for duplicates. It's also here the the entries might get remapped. Finally the staging registry is checked with the frozen registries to add any new entries that is missing in with the saved world, maybe a mod got updated and new block. The new block gets assigned a new entry id if the spot is already taken in the world's registry.