Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
65e425ebdb
Commit
9062bc698e
@ -36,13 +36,13 @@ public interface LaufbauState {
|
|||||||
default String eta(Player p, long start, int done, int total) {
|
default String eta(Player p, long start, int done, int total) {
|
||||||
if (total == 0) return "";
|
if (total == 0) return "";
|
||||||
long elapsed = System.currentTimeMillis() - start;
|
long elapsed = System.currentTimeMillis() - start;
|
||||||
long eta = (long) (elapsed / (done / (double) total) - elapsed);
|
long eta = ((long) (elapsed / (done / (double) total) - elapsed)) * 1000000;
|
||||||
if (eta > 86399999999999L) {
|
if (eta > 86399999999999L) {
|
||||||
return LocalTime.ofNanoOfDay(86399999999999L).format(DateTimeFormatter.ofPattern(BauSystem.MESSAGE.parse("TIME", p)));
|
return LocalTime.ofNanoOfDay(86399999999999L).format(DateTimeFormatter.ofPattern(BauSystem.MESSAGE.parse("TIME", p)));
|
||||||
}
|
}
|
||||||
if (eta < 0) {
|
if (eta < 0) {
|
||||||
return LocalTime.ofNanoOfDay(0).format(DateTimeFormatter.ofPattern(BauSystem.MESSAGE.parse("TIME", p)));
|
return LocalTime.ofNanoOfDay(0).format(DateTimeFormatter.ofPattern(BauSystem.MESSAGE.parse("TIME", p)));
|
||||||
}
|
}
|
||||||
return LocalTime.ofNanoOfDay(eta * 1000000).format(DateTimeFormatter.ofPattern(BauSystem.MESSAGE.parse("TIME", p)));
|
return LocalTime.ofNanoOfDay(eta).format(DateTimeFormatter.ofPattern(BauSystem.MESSAGE.parse("TIME", p)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren