I think this fixes the auto update config function when a config file has two similar keys.

This commit is contained in:
t00thpick1 2016-03-07 18:41:49 -05:00
parent 272e99d41f
commit 52f1e33052

View File

@ -88,8 +88,11 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
// Dump to the new one
for (String key : comments.keySet()) {
if (output.contains(key)) {
output = output.substring(0, output.indexOf(key)) + comments.get(key) + output.substring(output.indexOf(key));
if (output.contains(" " + key)) {
output = output.substring(0, output.indexOf(" " + key)) + comments.get(key) + output.substring(output.indexOf(" " + key));
}
if (output.contains("\n" + key)) {
output = output.substring(0, output.indexOf("\n" + key)) + comments.get(key) + output.substring(output.indexOf("\n" + key));
}
}
}