aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
index 13200d0..359f77b 100644
--- a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
+++ b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
@@ -102,8 +102,9 @@ public class AuthSessionHandler implements LimboSessionHandler {
}
if (bossBarEnabled) {
long timeSinceJoin = Settings.IMP.MAIN.AUTH_TIME - (System.currentTimeMillis() - AuthSessionHandler.this.joinTime);
- this.bossBar.name(this.deserialize(MessageFormat.format(Settings.IMP.MAIN.STRINGS.BOSSBAR, (int) (timeSinceJoin / 1000))));
- this.bossBar.progress((timeSinceJoin * bossBarMultiplier) / 1000);
+ this.bossBar.name(this.deserialize(MessageFormat.format(Settings.IMP.MAIN.STRINGS.BOSSBAR, (int) (timeSinceJoin / 1000F))));
+ // It is possible, that the progress value can overcome 1, e.g. 1.0000001.
+ this.bossBar.progress(Math.min((timeSinceJoin * bossBarMultiplier) / 1000F, 1F));
}
}).repeat(1, TimeUnit.SECONDS).schedule();