diff options
author | alemi <me@alemi.dev> | 2023-03-08 01:30:26 +0100 |
---|---|---|
committer | alemi <me@alemi.dev> | 2023-03-08 01:30:26 +0100 |
commit | 82e93b6359f548d7feaf2146c3c6c6c01b688eaa (patch) | |
tree | 8a72ca403b2cfbe49b068a58964d1f4275085c56 /src/main/java | |
parent | e42f5245db86d3d673e31c5efcc1036c26baea37 (diff) |
fix: re-enable saving state
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/ftbsc/bscv/api/IModule.java | 2 | ||||
-rw-r--r-- | src/main/java/ftbsc/bscv/modules/AbstractModule.java | 9 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/main/java/ftbsc/bscv/api/IModule.java b/src/main/java/ftbsc/bscv/api/IModule.java index d295023..2b0ea12 100644 --- a/src/main/java/ftbsc/bscv/api/IModule.java +++ b/src/main/java/ftbsc/bscv/api/IModule.java @@ -9,7 +9,7 @@ public interface IModule extends ICommand { ForgeConfigSpec.Builder getConfigBuilder(); default void toggle() { - if(this.isEnabled()) + if (this.isEnabled()) this.disable(); else this.enable(); } diff --git a/src/main/java/ftbsc/bscv/modules/AbstractModule.java b/src/main/java/ftbsc/bscv/modules/AbstractModule.java index fcf4363..384d593 100644 --- a/src/main/java/ftbsc/bscv/modules/AbstractModule.java +++ b/src/main/java/ftbsc/bscv/modules/AbstractModule.java @@ -73,15 +73,10 @@ public abstract class AbstractModule implements IModule { protected void onEnabled() {} protected void onDisabled() {} - public final void toggle() { - if (this.enabled.get()) this.disable(); - else this.enable(); - } - public final void enable() { MinecraftForge.EVENT_BUS.register(this); this.enabled.set(true); - // this.enabled.save(); + this.enabled.save(); this.onEnabled(); log(String.format("%s ON", this.getName())); } @@ -89,7 +84,7 @@ public abstract class AbstractModule implements IModule { public final void disable() { MinecraftForge.EVENT_BUS.unregister(this); this.enabled.set(false); - // this.enabled.save(); + this.enabled.save(); this.onDisabled(); log(String.format("%s OFF", this.getName())); } |