mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-20 07:02:32 +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
|
||||
*/
|
||||
public long toMilliseconds() {
|
||||
return TimeUnit.getMillis(value, temporalUnit);
|
||||
return toDuration().toMillis();
|
||||
}
|
||||
|
||||
public Duration toDuration() {
|
||||
return Duration.ofMillis(toMilliseconds());
|
||||
return Duration.of(value, temporalUnit);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user