diff --git a/NeoForge/src/main/java/vazkii/neat/NeatForgeInitializer.java b/NeoForge/src/main/java/vazkii/neat/NeatForgeInitializer.java deleted file mode 100644 index 48b86e3..0000000 --- a/NeoForge/src/main/java/vazkii/neat/NeatForgeInitializer.java +++ /dev/null @@ -1,20 +0,0 @@ -package vazkii.neat; - -import net.neoforged.bus.api.IEventBus; -import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.ModContainer; -import net.neoforged.fml.ModLoadingContext; -import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; -import net.neoforged.api.distmarker.Dist; -import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; - -@Mod(NeatConfig.MOD_ID) -public class NeatForgeInitializer { - - public NeatForgeInitializer(IEventBus bus, ModContainer modContainer) { - //ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (incoming, isNetwork) -> true)); - NeatForgeConfig.init(modContainer); - } - -} diff --git a/NeoForge/src/main/java/vazkii/neat/NeatForgeConfig.java b/NeoForge/src/main/java/vazkii/neat/NeatNeoForgeConfig.java similarity index 97% rename from NeoForge/src/main/java/vazkii/neat/NeatForgeConfig.java rename to NeoForge/src/main/java/vazkii/neat/NeatNeoForgeConfig.java index a17b97f..2f405d6 100644 --- a/NeoForge/src/main/java/vazkii/neat/NeatForgeConfig.java +++ b/NeoForge/src/main/java/vazkii/neat/NeatNeoForgeConfig.java @@ -1,20 +1,18 @@ package vazkii.neat; - import net.neoforged.fml.ModContainer; -import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.config.ModConfig; import net.neoforged.neoforge.common.ModConfigSpec; + import org.apache.commons.lang3.tuple.Pair; import java.util.List; -public class NeatForgeConfig { +public class NeatNeoForgeConfig { public static void init(ModContainer container) { Pair specPair = new ModConfigSpec.Builder().configure(ForgeNeatConfig::new); NeatConfig.instance = specPair.getLeft(); container.registerConfig(ModConfig.Type.CLIENT, specPair.getRight()); - //TODO consider using the build-in config ui of neoforge } private static class ForgeNeatConfig implements NeatConfig.ConfigAccess { diff --git a/NeoForge/src/main/java/vazkii/neat/NeatNeoForgeInitializer.java b/NeoForge/src/main/java/vazkii/neat/NeatNeoForgeInitializer.java new file mode 100644 index 0000000..9683598 --- /dev/null +++ b/NeoForge/src/main/java/vazkii/neat/NeatNeoForgeInitializer.java @@ -0,0 +1,15 @@ +package vazkii.neat; + +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.common.Mod; + +@Mod(NeatConfig.MOD_ID) +public class NeatNeoForgeInitializer { + + public NeatNeoForgeInitializer(IEventBus bus, ModContainer modContainer) { + //ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (incoming, isNetwork) -> true)); + NeatNeoForgeConfig.init(modContainer); + } + +} diff --git a/NeoForge/src/main/java/vazkii/neat/NeatNeoforgeClient.java b/NeoForge/src/main/java/vazkii/neat/NeatNeoforgeClient.java index 3e617a6..19d2f5e 100644 --- a/NeoForge/src/main/java/vazkii/neat/NeatNeoforgeClient.java +++ b/NeoForge/src/main/java/vazkii/neat/NeatNeoforgeClient.java @@ -14,12 +14,12 @@ @EventBusSubscriber(modid = NeatConfig.MOD_ID, bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) public class NeatNeoforgeClient { - public NeatNeoforgeClient(IEventBus bus, ModContainer modContainer) { - modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new); - } + public NeatNeoforgeClient(IEventBus bus, ModContainer modContainer) { + modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new); + } - @SubscribeEvent - public static void registerKey(RegisterKeyMappingsEvent event) { - event.register(ToggleKeybind.KEY); - } + @SubscribeEvent + public static void registerKey(RegisterKeyMappingsEvent event) { + event.register(ToggleKeybind.KEY); + } }