chore: AbstractModule

This commit is contained in:
ftbsc 2023-02-28 18:18:06 +01:00
parent d497c1d976
commit 3be09e9384

View file

@ -10,7 +10,7 @@ import net.minecraftforge.common.MinecraftForge;
import static ftbsc.bscv.BoSCoVicino.log; import static ftbsc.bscv.BoSCoVicino.log;
public abstract class Module { public abstract class AbstractModule {
public enum Group { public enum Group {
SELF, SELF,
HUD, HUD,
@ -66,7 +66,7 @@ public abstract class Module {
public abstract void register(ForgeConfigSpec.Builder builder, CommandDispatcher<CommandSource> dispatcher); public abstract void register(ForgeConfigSpec.Builder builder, CommandDispatcher<CommandSource> dispatcher);
protected Module(ForgeConfigSpec.Builder builder, CommandDispatcher<CommandSource> dispatcher) { protected AbstractModule(ForgeConfigSpec.Builder builder, CommandDispatcher<CommandSource> dispatcher) {
// TODO can this be done in a less magic way? // TODO can this be done in a less magic way?
String[] pkg = this.getClass().getPackage().getName().split("."); String[] pkg = this.getClass().getPackage().getName().split(".");
this.group = Group.valueOf(pkg[pkg.length-1].toUpperCase()); this.group = Group.valueOf(pkg[pkg.length-1].toUpperCase());
@ -75,7 +75,7 @@ public abstract class Module {
this.initialize(builder, dispatcher); this.initialize(builder, dispatcher);
} }
public Module done(ForgeConfigSpec.Builder builder) { public AbstractModule done(ForgeConfigSpec.Builder builder) {
builder.pop(); builder.pop();
return this; return this;
} }