1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Simplify error file name generation

This commit is contained in:
Oliver Wright 2018-03-02 20:03:11 +00:00
parent 9e0262d8b5
commit 273499a230
No known key found for this signature in database
GPG Key ID: 74EA9FD649807D37

View File

@ -99,33 +99,11 @@ public class TickerTask implements Runnable {
errors++; errors++;
if (errors == 1) { if (errors == 1) {
int try_count = 1;
File file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + ".err"); File file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + ".err");
if (file.exists()) { while (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(2).err"); try_count += 1;
if (file.exists()) { file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(" + try_count + ").err");
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(3).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(4).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(5).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(6).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(7).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(8).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(9).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(10).err");
}
}
}
}
}
}
}
}
} }
try { try {
PrintStream stream = new PrintStream(file); PrintStream stream = new PrintStream(file);