prayer plugin: fix time remaining text when greater than 1 hour

This commit is contained in:
Landy Chan
2020-08-19 13:40:26 -07:00
committed by GitHub
parent a4025e9270
commit 1a88b8e214
2 changed files with 161 additions and 2 deletions

View File

@@ -361,9 +361,14 @@ public class PrayerPlugin extends Plugin
LocalTime timeLeft = LocalTime.ofSecondOfDay((long) secondsLeft);
if (formatForOrb && timeLeft.getMinute() > 9)
if (formatForOrb && (timeLeft.getHour() > 0 || timeLeft.getMinute() > 9))
{
return timeLeft.format(DateTimeFormatter.ofPattern("m")) + "m";
long minutes = Duration.ofSeconds((long) secondsLeft).toMinutes();
return String.format("%dm", minutes);
}
else if (timeLeft.getHour() > 0)
{
return timeLeft.format(DateTimeFormatter.ofPattern("H:mm:ss"));
}
else
{