mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45: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++;
|
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user