summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java4
1 files changed, 4 insertions, 0 deletions
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.");