Skip to content

Commit 20a1a91

Browse files
Refactor MyPlugin class to use KPlugin
Updated the example code for plugin registration.
1 parent a6393c0 commit 20a1a91

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ api-version: '1.21'
9595
Note: Commands are auto-registered by the plugin. Listeners are discovered but you must register them manually in your plugin's enable phase:
9696

9797
```kotlin
98-
class MyPlugin : org.bukkit.plugin.java.JavaPlugin() {
99-
override fun onEnable() {
98+
import cc.modlabs.kpaper.main.KPlugin
99+
100+
class MyPlugin : KPlugin() {
101+
override fun startup() {
100102
cc.modlabs.registration.RegisterManager.registerListeners(this)
101103
}
102104
}

0 commit comments

Comments
 (0)