mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-01 04:51:29 +01:00
Simplify conversion logic and only use java.time
This commit is contained in:
parent
3f1c433c94
commit
efb450ce50
@ -48,10 +48,10 @@ public class UpdateOption {
|
|||||||
* @return the converted milliseconds based on the time value and the unit
|
* @return the converted milliseconds based on the time value and the unit
|
||||||
*/
|
*/
|
||||||
public long toMilliseconds() {
|
public long toMilliseconds() {
|
||||||
return TimeUnit.getMillis(value, temporalUnit);
|
return toDuration().toMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Duration toDuration() {
|
public Duration toDuration() {
|
||||||
return Duration.ofMillis(toMilliseconds());
|
return Duration.of(value, temporalUnit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user