From 58bae20f10b5192173236a9ffa6db85d95a22e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9meth=20Noel?= Date: Wed, 30 Jun 2021 00:47:57 +0200 Subject: [PATCH] Updated Main.java --- src/test/java/demo/Main.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/demo/Main.java b/src/test/java/demo/Main.java index c3cec28cc..8347e5018 100644 --- a/src/test/java/demo/Main.java +++ b/src/test/java/demo/Main.java @@ -22,7 +22,8 @@ import net.minestom.server.storage.StorageManager; import net.minestom.server.storage.systems.FileStorageSystem; import net.minestom.server.utils.identity.NamedAndIdentified; import net.minestom.server.utils.time.TimeUnit; -import net.minestom.server.utils.time.UpdateOption; + +import java.time.Duration; public class Main { @@ -62,7 +63,7 @@ public class Main { StorageManager storageManager = MinecraftServer.getStorageManager(); storageManager.defineDefaultStorageSystem(FileStorageSystem::new); - MinecraftServer.getBenchmarkManager().enable(new UpdateOption(10 * 1000, TimeUnit.MILLISECOND)); + MinecraftServer.getBenchmarkManager().enable(Duration.of(10 * 1000, TimeUnit.MILLISECOND)); MinecraftServer.getSchedulerManager().buildShutdownTask(() -> System.out.println("Good night")).schedule(); @@ -110,7 +111,7 @@ public class Main { //MojangAuth.init(); // useful for testing - we don't need to worry about event calls so just set this to a long time - OpenToLAN.open(new OpenToLANConfig().eventCallDelay(new UpdateOption(1, TimeUnit.DAY))); + OpenToLAN.open(new OpenToLANConfig().eventCallDelay(Duration.of(1, TimeUnit.DAY))); minecraftServer.start("0.0.0.0", 25565); //Runtime.getRuntime().addShutdownHook(new Thread(MinecraftServer::stopCleanly));