update event docs (#264)
This commit is contained in:
1 parent
58fd2b6dde
commit
95d2d72a6b
1 file changed
+2
-2
@@ -42,7 +42,7 @@ public class ExampleMod implements ModInitializer, EventRegistrar {
|
|||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
ServerLifecycleEvents.SERVER_STARTING.register((server) -> {
|
ServerLifecycleEvents.SERVER_STARTING.register((server) -> {
|
||||||
GeyserApi.api().eventBus().register(this, ExampleMod.class); // register your mod & this class as a listener
|
GeyserApi.api().eventBus().register(this, this); // register your mod & this class instance as a listener
|
||||||
});
|
});
|
||||||
|
|
||||||
LOGGER.info("Geyser is cool!");
|
LOGGER.info("Geyser is cool!");
|
||||||
@@ -76,7 +76,7 @@ public class ExamplePlugin extends JavaPlugin implements EventRegistrar {
|
|||||||
@Override
|
@Override
|
||||||
public void onEnable(){
|
public void onEnable(){
|
||||||
getLogger().info("Registering Geyser event bus!");
|
getLogger().info("Registering Geyser event bus!");
|
||||||
GeyserApi.api().eventBus().register(this, this); // register your plugin & this class as a listener
|
GeyserApi.api().eventBus().register(this, this); // register your plugin & this class instance as a listener
|
||||||
}
|
}
|
||||||
|
|
||||||
// here an event, we subscribe as usual with the @Subscribe annotation
|
// here an event, we subscribe as usual with the @Subscribe annotation
|
||||||
|
|||||||
Reference in new issue
Block a user