diff options
author | Keuin <[email protected]> | 2022-09-17 15:59:40 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-09-17 15:59:40 +0800 |
commit | 3e8fae576d7afccb29f5a35d07df970bafdecd36 (patch) | |
tree | 41fdeb6c19bb3daef7ca7054a9bbb84fed0cd8b6 /src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java | |
parent | ea3658cd57899398d885d86be9f74798b8c5ef39 (diff) |
stashed updatesmaster-auto-backup
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java | 4 |
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."); |