Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit

Permalink
🍱 fix shutdown update bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Belikhun committed Jun 6, 2022
1 parent a925bd1 commit 36774a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public void update(BossBar bar, double remain) {
ChatColor textColor = ChatColor.of("#ff3b62");

String message = (reason != null)
? String.format("&r%s&l⚠⚠⚠ TẮT MÁY CHỦ ⚠⚠⚠&r sau %s &7(%s)", textColor, remain, reason)
: String.format("&r%s&l⚠⚠⚠ TẮT MÁY CHỦ ⚠⚠⚠&r sau %s", textColor, CountInstance.readableTime(remain));
? String.format("&r%s&l⚠⚠⚠ TẮT MÁY CHỦ ⚠⚠⚠&r sau &b%s&r &7(%s)", textColor, CountInstance.readableTime(remain), reason)
: String.format("&r%s&l⚠⚠⚠ TẮT MÁY CHỦ ⚠⚠⚠&r sau &b%s&r", textColor, CountInstance.readableTime(remain));

bar.setTitle(Countdown.colorize(message));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void run() {
if (progress >= 0) {
bar.setProgress(progress);

if (progress < .2)
if (progress < .3)
color = BarColor.RED;
else if (progress < .6)
color = BarColor.YELLOW;
Expand Down Expand Up @@ -119,10 +119,10 @@ public void run() {

public static String readableTime(double seconds) {
return (seconds / 3600d > 1)
? String.format("%s%.1fh&r", timeColor[0], (seconds / 3600d))
? String.format("%s%.0fh %.2fm&r", timeColor[0], Math.floor(seconds / 3600d), (seconds % 3600d) / 60d)
: ((seconds > 300d)
? String.format("%s%.2fm&r", timeColor[1], (seconds / 60d))
: String.format("%s%.3fs&r", timeColor[2], seconds));
? String.format("%s%.0fm %.0fs&r", timeColor[1], Math.floor(seconds / 60d), (seconds % 60d))
: String.format("%s%.1fs&r", timeColor[2], seconds));
}

public static void handlePlayerJoin(Player player) {
Expand Down

0 comments on commit 36774a4

Please sign in to comment.