Skip to content

Commit 77ff0ec

Browse files
Update registry example
Co-authored-by: Lulu13022002 <[email protected]>
1 parent 22afdaf commit 77ff0ec

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/content/docs/paper/dev/api/dialogs.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,13 @@ event in your plugin's bootstrapper. Some general information on that can be rea
149149
The general registration looks fairly similar to dynamically created dialogs:
150150
```java title="YourPluginBootstrapper.java"
151151
@Override
152-
public void bootstrap(BootstrapContext ctx) {
153-
ctx.getLifecycleManager().registerEventHandler(RegistryEvents.DIALOG.compose()
154-
.newHandler(event -> event.registry().registerWith(
155-
TypedKey.create(RegistryKey.DIALOG, Key.key("papermc:custom_dialog")),
156-
builder -> builder.empty()
157-
// ... build your dialog here
152+
public void bootstrap(BootstrapContext context) {
153+
context.getLifecycleManager().registerEventHandler(RegistryEvents.DIALOG.compose()
154+
.newHandler(event -> event.registry().register(
155+
DialogKeys.create(Key.key("papermc:custom_dialog")),
156+
builder -> {
157+
// ... build your dialog here
158+
}
158159
)));
159160
}
160161
```

0 commit comments

Comments
 (0)