File tree Expand file tree Collapse file tree
src/content/docs/paper/dev/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11patchedDependencies :
22 ' @astrojs/starlight@0.34.3 ' : patches/@astrojs__starlight@0.34.3.patch
3+
4+ onlyBuiltDependencies :
5+ - esbuild
6+ - sharp
Original file line number Diff line number Diff line change @@ -123,19 +123,19 @@ Modification of a registry can take two different forms.
123123
124124### Create new entries
125125
126- Creating new entries is done via the [ ` freeze ` lifecycle event] ( jd:paper:io.papermc.paper.registry.event.RegistryEventProvider#freeze () )
126+ Creating new entries is done via the [ ` compose ` lifecycle event] ( jd:paper:io.papermc.paper.registry.event.RegistryEventProvider#compose () )
127127on the respective registries.
128- The freeze event is called right before a registry's content is frozen in-place, meaning all Vanilla entries are registered.
129- Plugins can hence register their own entries at this point.
128+ The compose event is called after a registry's content has been loaded from "vanilla" sources, like the built-in
129+ datapack or any detected, enabled, datapacks. Plugins can hence register their own entries at this point.
130130The following example shows how to create a new enchantment:
131131
132132``` java title="TestPluginBootstrap.java"
133133public class TestPluginBootstrap implements PluginBootstrap {
134134
135135 @Override
136136 public void bootstrap (BootstrapContext context ) {
137- // Register a new handler for the freeze lifecycle event on the enchantment registry
138- context. getLifecycleManager(). registerEventHandler(RegistryEvents . ENCHANTMENT. freeze (). newHandler(event - > {
137+ // Register a new handler for the compose lifecycle event on the enchantment registry
138+ context. getLifecycleManager(). registerEventHandler(RegistryEvents . ENCHANTMENT. compose (). newHandler(event - > {
139139 event. registry(). register(
140140 // The key of the registry
141141 // Plugins should use their own namespace instead of minecraft or papermc
You can’t perform that action at this time.
0 commit comments