mirror of
https://github.com/SunNetservers/MiniGames.git
synced 2025-01-19 03:35:25 +01:00
Adds two decimals to best time placeholders
This commit is contained in:
parent
81e652b4ff
commit
0360ada849
@ -31,17 +31,17 @@ public class LongRecord extends SummableArenaRecord<Long> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAsString() {
|
public String getAsString() {
|
||||||
int seconds = (int) Math.floor(getRecord() / 1000.0);
|
double seconds = getRecord() / 1000.0;
|
||||||
int minutes = 0;
|
double minutes = 0;
|
||||||
if (seconds > 60) {
|
if (seconds > 60) {
|
||||||
minutes = (int) Math.floor(seconds / 60.0);
|
minutes = seconds / 60.0;
|
||||||
seconds = seconds % 60;
|
seconds = seconds % 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minutes > 0) {
|
if (minutes > 0) {
|
||||||
return minutes + "m" + seconds + "s";
|
return String.format("%.0fm%.2fs", minutes, seconds);
|
||||||
} else {
|
} else {
|
||||||
return seconds + "s";
|
return String.format("%.2fs", seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +53,8 @@ public class LongRecord extends SummableArenaRecord<Long> {
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public static LongRecord deserialize(@NotNull Map<String, Object> data) {
|
public static LongRecord deserialize(@NotNull Map<String, Object> data) {
|
||||||
return new LongRecord(((SerializableUUID) data.get("userId")).getRawValue(), ((Number) data.get("record")).longValue());
|
return new LongRecord(((SerializableUUID) data.get("userId")).getRawValue(),
|
||||||
|
((Number) data.get("record")).longValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user