Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 3a938c3

Browse files
committed
fix
1 parent 0c6c9e8 commit 3a938c3

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/main/java/org/localmc/tools/hardcodepatcher/HardcodePatcher.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.localmc.tools.hardcodepatcher;
22

33
import com.mojang.logging.LogUtils;
4-
import net.fabricmc.fabric.api.event.EventFactory;
54
import org.localmc.tools.hardcodepatcher.command.CommandEventHandler;
65
import org.localmc.tools.hardcodepatcher.config.HardcodeTextPatcherConfig;
76
import org.localmc.tools.hardcodepatcher.config.HardcodeTextPatcherPatch;
@@ -26,8 +25,25 @@ public class HardcodePatcher implements ModInitializer {
2625
@Override
2726
public void onInitialize() {
2827
CommandRegistrationCallback.EVENT.register(CommandEventHandler::registerClientCommands);
29-
}
3028

29+
try {
30+
HardcodeTextPatcherConfig.readConfig();
31+
List<String> mods = HardcodeTextPatcherConfig.getMods();
32+
for (String mod : mods) {
33+
HardcodeTextPatcherPatch vpp = new HardcodeTextPatcherPatch(mod + ".json");
34+
try {
35+
vpp.readConfig();
36+
vpps.add(vpp);
37+
} catch (IOException e) {
38+
e.printStackTrace();
39+
}
40+
}
41+
} catch (IOException e) {
42+
LOGGER.error("Failed to load config: ", e);
43+
throw new RuntimeException(e);
44+
}
45+
}
46+
/*
3147
public static void loadConfig() {
3248
try {
3349
HardcodeTextPatcherConfig.readConfig();
@@ -46,4 +62,5 @@ public static void loadConfig() {
4662
throw new RuntimeException(e);
4763
}
4864
}
65+
*/
4966
}

0 commit comments

Comments
 (0)