mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-09-09 12:38:01 +02:00
Tiny cleanup to #expiry method in NodeBuilder
This commit is contained in:
parent
2eabe845d7
commit
6a96d40da4
@ -31,6 +31,7 @@ import net.luckperms.api.node.metadata.NodeMetadataKey;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.temporal.TemporalAccessor;
|
||||
import java.time.temporal.TemporalAmount;
|
||||
import java.util.Objects;
|
||||
@ -111,8 +112,7 @@ public interface NodeBuilder<N extends ScopedNode<N, B>, B extends NodeBuilder<N
|
||||
throw new IllegalArgumentException("duration must be positive");
|
||||
}
|
||||
long seconds = Objects.requireNonNull(unit, "unit").toSeconds(duration);
|
||||
long timeNow = System.currentTimeMillis() / 1000L;
|
||||
return expiry(timeNow + seconds);
|
||||
return expiry(Duration.ofSeconds(seconds));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user