From 3fec30949a82914b6e9e59eaab00efbe33619a45 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Thu, 25 May 2023 17:03:31 +0100 Subject: [PATCH] Add disable method to the extensions api --- .../java/org/geysermc/geyser/api/extension/Extension.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/src/main/java/org/geysermc/geyser/api/extension/Extension.java b/api/src/main/java/org/geysermc/geyser/api/extension/Extension.java index 33fc159de..993bdee44 100644 --- a/api/src/main/java/org/geysermc/geyser/api/extension/Extension.java +++ b/api/src/main/java/org/geysermc/geyser/api/extension/Extension.java @@ -136,4 +136,12 @@ public interface Extension extends EventRegistrar { default GeyserApi geyserApi() { return GeyserApi.api(); } + + /** + * Disable the extension. + */ + default void disable() { + this.setEnabled(false); + this.eventBus().unregisterAll(); + } }