Fix the config is not being used at all (#6)

This commit is contained in:
楓 authored and GitHub committed 2026-02-04 06:31:21 +01:00
1 parent 7bf7868ef9
commit febf05656e
2 files changed
+15 -14

No files matched your search

@@ -1,9 +1,7 @@
package net.moecraft.nechar;
import java.io.File;
import java.util.function.BiConsumer;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.ClientCommandHandler;
import net.vfyjxf.nechar.NechCommand;
import net.vfyjxf.nechar.NechConfig;
@@ -81,7 +79,6 @@ public class NotEnoughCharacters {
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
logger.info("Not Enough Characters - v" + VERSION);
NechConfig.loadConfig(new File(Minecraft.getMinecraft().mcDataDir, "config/NotEnoughCharacters.cfg"));
onConfigChange();
}
+15 -11
View File
@@ -28,7 +28,7 @@ public class NechConfig {
public static String[] defaultTransformerRegExp = new String[] { "appeng.client.me.ItemRepo:updateView", // Applied-Energistics-2
// search
"net.p455w0rd.wirelesscraftingterminal.client.me.ItemRepo:updateView", // WirelessCraftingTerminal search
"com.glodblock.github.client.me.FluidRepo:updateView", // Ae2fc
"com.glodblock.github.client.me.FluidRepo:addEntriesToView", // Ae2fc
"com.glodblock.github.client.me.EssentiaRepo:updateView"
};
@@ -72,14 +72,14 @@ public class NechConfig {
"transformers",
"DefaultTransformerRegExp",
defaultTransformerRegExp,
"Default list of methods to transform, of which uses regular expression to match.\n"
+ "This list is maintained by the mod and will have no effect if you change it.");
"Default list of methods to transform, of which uses regular expression to match (Pattern.matcher or String.matches).\n"
+ "THIS IS GENERATED BY NECH, DON'T EDIT!");
config.get(
"transformers",
"DefaultTransformerString",
defaultTransformerStringList,
"Default list of methods to transform, of which uses \"String.contains\" to match.\n"
+ "This list is maintained by the mod and will have no effect if you change it.");
+ "THIS IS GENERATED BY NECH, DON'T EDIT!");
config.getCategory("transformers")
.get("DefaultTransformerRegExp")
@@ -88,13 +88,12 @@ public class NechConfig {
.get("DefaultTransformerString")
.set(defaultTransformerStringList);
transformerRegExpAdditionalList = config
.get(
"transformers",
"AdditionalTransformerRegExpList",
new String[0],
"Additional list of methods to transform, of which uses regular expression to match.\n"
+ "The format is \"full.class.path$InnerClass:methodName\"")
transformerRegExpAdditionalList = config.get(
"transformers",
"AdditionalTransformerRegExpList",
new String[0],
"Additional list of methods to transform, of which uses regular expression to match (Pattern.matcher or String.matches).\n"
+ "The format is \"full.class.path$InnerClass:methodName\"")
.getStringList();
transformerStringAdditionalList = config
@@ -199,4 +198,9 @@ public class NechConfig {
}
}
static {
// load the config as soon as this class is loaded, so that the reader will get the updated value.
loadConfig(new File("config/NotEnoughCharacters.cfg"));
}
}