Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/main/java/net/moecraft/nechar/NotEnoughCharacters.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -81,7 +79,6 @@ public static void onConfigChange() {
@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();
}

Expand Down
26 changes: 15 additions & 11 deletions src/main/java/net/vfyjxf/nechar/NechConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"

};
Expand Down Expand Up @@ -72,14 +72,14 @@ public static void loadConfig(File configFile) {
"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")
Expand All @@ -88,13 +88,12 @@ public static void loadConfig(File configFile) {
.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
Expand Down Expand Up @@ -199,4 +198,9 @@ public Keyboard get() {
}
}

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"));
}

}