feat: defaults for toggle/enable/disable
This commit is contained in:
parent
4359e3d285
commit
c833568c4b
1 changed files with 12 additions and 3 deletions
|
@ -1,17 +1,26 @@
|
||||||
package ftbsc.bscv.api;
|
package ftbsc.bscv.api;
|
||||||
|
|
||||||
import net.minecraftforge.common.ForgeConfigSpec;
|
import net.minecraftforge.common.ForgeConfigSpec;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
public interface IModule<T extends Enum<T>> extends ICommand {
|
public interface IModule<T extends Enum<T>> extends ICommand {
|
||||||
T getGroup();
|
T getGroup();
|
||||||
|
|
||||||
ForgeConfigSpec.Builder getConfigBuilder();
|
ForgeConfigSpec.Builder getConfigBuilder();
|
||||||
|
|
||||||
void toggle();
|
default void toggle() {
|
||||||
|
if(this.isEnabled())
|
||||||
|
this.disable();
|
||||||
|
else this.enable();
|
||||||
|
}
|
||||||
|
|
||||||
void enable();
|
default void enable() {
|
||||||
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
}
|
||||||
|
|
||||||
void disable();
|
default void disable() {
|
||||||
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
}
|
||||||
|
|
||||||
boolean isEnabled();
|
boolean isEnabled();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue