mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-06 16:37:38 +01:00
Updated Main.java
This commit is contained in:
parent
7f9737d866
commit
58bae20f10
@ -22,7 +22,8 @@ import net.minestom.server.storage.StorageManager;
|
|||||||
import net.minestom.server.storage.systems.FileStorageSystem;
|
import net.minestom.server.storage.systems.FileStorageSystem;
|
||||||
import net.minestom.server.utils.identity.NamedAndIdentified;
|
import net.minestom.server.utils.identity.NamedAndIdentified;
|
||||||
import net.minestom.server.utils.time.TimeUnit;
|
import net.minestom.server.utils.time.TimeUnit;
|
||||||
import net.minestom.server.utils.time.UpdateOption;
|
|
||||||
|
import java.time.Duration;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
@ -62,7 +63,7 @@ public class Main {
|
|||||||
StorageManager storageManager = MinecraftServer.getStorageManager();
|
StorageManager storageManager = MinecraftServer.getStorageManager();
|
||||||
storageManager.defineDefaultStorageSystem(FileStorageSystem::new);
|
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();
|
MinecraftServer.getSchedulerManager().buildShutdownTask(() -> System.out.println("Good night")).schedule();
|
||||||
|
|
||||||
@ -110,7 +111,7 @@ public class Main {
|
|||||||
//MojangAuth.init();
|
//MojangAuth.init();
|
||||||
|
|
||||||
// useful for testing - we don't need to worry about event calls so just set this to a long time
|
// 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);
|
minecraftServer.start("0.0.0.0", 25565);
|
||||||
//Runtime.getRuntime().addShutdownHook(new Thread(MinecraftServer::stopCleanly));
|
//Runtime.getRuntime().addShutdownHook(new Thread(MinecraftServer::stopCleanly));
|
||||||
|
Loading…
Reference in New Issue
Block a user