mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-24 08:14:25 +00:00
Make use of Instant / Duration classes where possible for time handling
This commit is contained in:
38 files changed
+311
-340
No files matched your search
@@ -57,6 +57,7 @@ import org.spongepowered.api.scheduler.SynchronousExecutor;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Instant;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
@@ -102,7 +103,7 @@ public class LPSpongeBootstrap implements LuckPermsBootstrap {
|
||||
/**
|
||||
* The time when the plugin was enabled
|
||||
*/
|
||||
private long startTime;
|
||||
private Instant startTime;
|
||||
|
||||
// load/enable latches
|
||||
private final CountDownLatch loadLatch = new CountDownLatch(1);
|
||||
@@ -162,7 +163,7 @@ public class LPSpongeBootstrap implements LuckPermsBootstrap {
|
||||
|
||||
@Listener(order = Order.FIRST)
|
||||
public void onEnable(GamePreInitializationEvent event) {
|
||||
this.startTime = System.currentTimeMillis();
|
||||
this.startTime = Instant.now();
|
||||
try {
|
||||
this.plugin.load();
|
||||
} finally {
|
||||
@@ -218,7 +219,7 @@ public class LPSpongeBootstrap implements LuckPermsBootstrap {
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getStartupTime() {
|
||||
public Instant getStartupTime() {
|
||||
return this.startTime;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user