mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Handle this nicer
This commit is contained in:
parent
6baf820afa
commit
2e2abcd645
@ -63,7 +63,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
|
|||||||
output = output.replace(" ", " ");
|
output = output.replace(" ", " ");
|
||||||
|
|
||||||
// Rip out Bukkit's attempt to save comments at the top of the file
|
// Rip out Bukkit's attempt to save comments at the top of the file
|
||||||
while (!output.startsWith("General:")) {
|
while (output.replaceAll("[//s]", "").startsWith("#")) {
|
||||||
output = output.substring(output.indexOf('\n', output.indexOf('#')) + 1);
|
output = output.substring(output.indexOf('\n', output.indexOf('#')) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
|
|||||||
|
|
||||||
// Dump to the new one
|
// Dump to the new one
|
||||||
for (String key : comments.keySet()) {
|
for (String key : comments.keySet()) {
|
||||||
if (output.indexOf(key) != -1) {
|
if (output.contains(key)) {
|
||||||
output = output.substring(0, output.indexOf(key)) + comments.get(key) + output.substring(output.indexOf(key));
|
output = output.substring(0, output.indexOf(key)) + comments.get(key) + output.substring(output.indexOf(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user