aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/OneConfig.java
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-04-26 20:35:35 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-04-26 20:35:35 +0200
commitaad5111d45a66d943f0bcbe885ccb28249441d11 (patch)
tree94bcedd85c1725a7a813185b0a931ffc3eb215fd /src/main/java/io/polyfrost/oneconfig/OneConfig.java
parent5eb52cdd6ce2e65be7eefecfea7cfdb63404f481 (diff)
downloadOneConfig-aad5111d45a66d943f0bcbe885ccb28249441d11.tar.gz
OneConfig-aad5111d45a66d943f0bcbe885ccb28249441d11.tar.bz2
OneConfig-aad5111d45a66d943f0bcbe885ccb28249441d11.zip
config system rewrite
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/OneConfig.java')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/OneConfig.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/OneConfig.java b/src/main/java/io/polyfrost/oneconfig/OneConfig.java
index f3668d8..658536a 100644
--- a/src/main/java/io/polyfrost/oneconfig/OneConfig.java
+++ b/src/main/java/io/polyfrost/oneconfig/OneConfig.java
@@ -3,7 +3,7 @@ package io.polyfrost.oneconfig;
import io.polyfrost.oneconfig.command.OneConfigCommand;
import io.polyfrost.oneconfig.config.OneConfigConfig;
import io.polyfrost.oneconfig.config.core.ConfigCore;
-import io.polyfrost.oneconfig.config.data.ModData;
+import io.polyfrost.oneconfig.config.data.Mod;
import io.polyfrost.oneconfig.config.data.ModType;
import io.polyfrost.oneconfig.hud.HudCore;
import io.polyfrost.oneconfig.test.TestConfig;
@@ -11,7 +11,6 @@ import net.minecraft.client.Minecraft;
import net.minecraftforge.client.ClientCommandHandler;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Loader;
-import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.ModContainer;
import net.minecraftforge.fml.common.ModMetadata;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
@@ -23,7 +22,7 @@ import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
-@Mod(modid = "@ID@", name = "@NAME@", version = "@VER@")
+@net.minecraftforge.fml.common.Mod(modid = "@ID@", name = "@NAME@", version = "@VER@")
public class OneConfig {
private static final Minecraft mc = Minecraft.getMinecraft();
public static File jarFile;
@@ -31,10 +30,10 @@ public class OneConfig {
public static File themesDir = new File(oneConfigDir, "themes/");
public static OneConfigConfig config;
public static TestConfig testConfig;
- public static List<ModData> loadedMods = new ArrayList<>();
+ public static List<Mod> loadedMods = new ArrayList<>();
public static List<ModMetadata> loadedOtherMods = new ArrayList<>();
- @Mod.EventHandler
+ @net.minecraftforge.fml.common.Mod.EventHandler
public void onPreFMLInit(FMLPreInitializationEvent event) {
jarFile = event.getSourceFile();
oneConfigDir.mkdirs();
@@ -42,7 +41,7 @@ public class OneConfig {
config = new OneConfigConfig();
}
- @Mod.EventHandler
+ @net.minecraftforge.fml.common.Mod.EventHandler
public void onFMLInitialization(FMLInitializationEvent event) {
testConfig = new TestConfig();
ClientCommandHandler.instance.registerCommand(new OneConfigCommand());
@@ -50,19 +49,19 @@ public class OneConfig {
MinecraftForge.EVENT_BUS.register(new HudCore());
}
- @Mod.EventHandler
+ @net.minecraftforge.fml.common.Mod.EventHandler
public void onPostFMLInit(FMLPostInitializationEvent event) {
reloadModsList();
}
public static void reloadModsList() {
loadedMods.addAll(ConfigCore.settings.keySet());
- LinkedHashSet<ModData> modData = new LinkedHashSet<>(ConfigCore.settings.keySet());
+ LinkedHashSet<Mod> modData = new LinkedHashSet<>(ConfigCore.settings.keySet());
for (ModContainer mod : Loader.instance().getActiveModList()) {
ModMetadata metadata = mod.getMetadata();
loadedOtherMods.add(metadata);
String author = metadata.authorList.size() > 0 ? metadata.authorList.get(0) : "";
- ModData newMod = new ModData(metadata.name, ModType.OTHER, author, metadata.version);
+ Mod newMod = new Mod(metadata.name, ModType.OTHER, author, metadata.version);
if (newMod.name.equals("Minecraft Coder Pack") || newMod.name.equals("Forge Mod Loader") || newMod.name.equals("Minecraft Forge")) { // TODO add oneconfig
continue;
}