Add disable method to the extensions api

This commit is contained in:
rtm516 2023-05-25 17:03:31 +01:00
parent f7d2b4ece3
commit 3fec30949a
No known key found for this signature in database
GPG key ID: 331715B8B007C67A

View file

@ -136,4 +136,12 @@ public interface Extension extends EventRegistrar {
default GeyserApi geyserApi() { default GeyserApi geyserApi() {
return GeyserApi.api(); return GeyserApi.api();
} }
/**
* Disable the extension.
*/
default void disable() {
this.setEnabled(false);
this.eventBus().unregisterAll();
}
} }