From 3e8fae576d7afccb29f5a35d07df970bafdecd36 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 17 Sep 2022 15:59:40 +0800 Subject: stashed updates --- src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java') diff --git a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java index 2b2865e..e0cb622 100644 --- a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java +++ b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java @@ -7,6 +7,7 @@ import com.keuin.kbackupfabric.metadata.BackupMetadata; import com.keuin.kbackupfabric.metadata.MetadataHolder; import com.keuin.kbackupfabric.notification.DistinctNotifiable; import com.keuin.kbackupfabric.notification.NotificationManager; +import com.keuin.kbackupfabric.singleton.MinecraftServerInstance; import com.keuin.kbackupfabric.ui.KBCommands; import com.keuin.kbackupfabric.util.DateUtil; import com.keuin.kbackupfabric.util.PrintUtil; @@ -41,6 +42,9 @@ public final class KBPluginEvents implements ModInitializer, ServerStartCallback @Override public void onStartServer(MinecraftServer server) { + // Set singleton holder, so in other place we can use MinecraftServerInstance to get a reference + MinecraftServerInstance.setInstance(server); + // Buggy: this does not work if (!(server instanceof MinecraftDedicatedServer)) throw new RuntimeException("KBackup is a server-side-only plugin. Please do not use it in client-side."); -- cgit v1.2.3