mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01: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.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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user