We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e94ffb commit 6c74d97Copy full SHA for 6c74d97
1 file changed
shared/src/main/java/net/pistonmaster/pistonqueue/shared/SharedChatUtils.java
@@ -26,10 +26,9 @@ private SharedChatUtils() {
26
}
27
28
public static String formatDuration(String str, Duration duration, int position) {
29
- String format = String.format("%dh %dm", duration.toHours(), duration.toMinutes() % 60);
30
-
31
- if (duration.toHours() == 0)
32
- format = String.format("%dm", duration.toMinutes() == 0 ? 1 : duration.toMinutes());
+ String format = duration.toHours() == 0 ?
+ String.format("%dm", duration.toMinutes() == 0 ? 1 : duration.toMinutes()) :
+ String.format("%dh %dm", duration.toHours(), duration.toMinutes() % 60);
33
34
return str.replace("%position%", String.valueOf(position)).replace("%wait%", format);
35
0 commit comments