mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-09-25 13:28:58 +02:00
Tiny cleanup to #expiry method in NodeBuilder
This commit is contained in:
@@ -31,6 +31,7 @@ import net.luckperms.api.node.metadata.NodeMetadataKey;
|
|||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
import java.time.temporal.TemporalAccessor;
|
import java.time.temporal.TemporalAccessor;
|
||||||
import java.time.temporal.TemporalAmount;
|
import java.time.temporal.TemporalAmount;
|
||||||
import java.util.Objects;
|
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");
|
throw new IllegalArgumentException("duration must be positive");
|
||||||
}
|
}
|
||||||
long seconds = Objects.requireNonNull(unit, "unit").toSeconds(duration);
|
long seconds = Objects.requireNonNull(unit, "unit").toSeconds(duration);
|
||||||
long timeNow = System.currentTimeMillis() / 1000L;
|
return expiry(Duration.ofSeconds(seconds));
|
||||||
return expiry(timeNow + seconds);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user