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