diff options
-rw-r--r-- | src/main/java/co/fantabos/bscv/Module.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/co/fantabos/bscv/Module.java b/src/main/java/co/fantabos/bscv/Module.java index 295d6a8..dad3d56 100644 --- a/src/main/java/co/fantabos/bscv/Module.java +++ b/src/main/java/co/fantabos/bscv/Module.java @@ -41,18 +41,23 @@ public abstract class Module { ); } - public void toggle() { + protected void onEnabled() {} + protected void onDisabled() {} + + public final void toggle() { if (this.enabled.get()) this.disable(); else this.enable(); } - public void enable() { + public final void enable() { MinecraftForge.EVENT_BUS.register(this); this.enabled.set(true); + this.onEnabled(); } - public void disable() { + public final void disable() { MinecraftForge.EVENT_BUS.unregister(this); this.enabled.set(false); + this.onDisabled(); } } |