Fixed bug where config categories errored if they contained regex special characters. (#4187)

This commit is contained in:
diesieben07 authored and LexManos committed 2017-08-01 13:38:14 -05:00
1 parent d3fa82c18a
commit 7df003c3e7
1 file changed
+3 -1
@@ -43,6 +43,8 @@ import net.minecraftforge.fml.common.discovery.ASMDataTable;
import net.minecraftforge.fml.common.discovery.ASMDataTable.ASMData;
import net.minecraftforge.fml.common.discovery.asm.ModAnnotation.EnumHolder;
import org.apache.commons.lang3.StringUtils;
public class ConfigManager
{
private static Map<String, Multimap<Config.Type, ASMData>> asm_data = Maps.newHashMap();
@@ -246,7 +248,7 @@ public class ConfigManager
for (String key : wrapper.getKeys())
{
String suffix = key.replaceFirst(wrapper.getCategory() + ".", "");
String suffix = StringUtils.replaceOnce(key, wrapper.getCategory() + ".", "");
boolean existed = exists(cfg, wrapper.getCategory(), suffix);
if (!existed || loading) //Creates keys in category specified by the wrapper if new ones are programaticaly added