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:
parent
9e0262d8b5
commit
273499a230
@ -99,33 +99,11 @@ public class TickerTask implements Runnable {
|
||||
errors++;
|
||||
|
||||
if (errors == 1) {
|
||||
int try_count = 1;
|
||||
File file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + ".err");
|
||||
if (file.exists()) {
|
||||
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(2).err");
|
||||
if (file.exists()) {
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while (file.exists()) {
|
||||
try_count += 1;
|
||||
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(" + try_count + ").err");
|
||||
}
|
||||
try {
|
||||
PrintStream stream = new PrintStream(file);
|
||||
|
Loading…
Reference in New Issue
Block a user