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.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java
index 8992d17..a8c3e0c 100644
--- a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java
+++ b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java
@@ -2,8 +2,11 @@ package com.keuin.kbackupfabric;
import com.keuin.kbackupfabric.backup.BackupFilesystemUtil;
import com.keuin.kbackupfabric.backup.suggestion.BackupNameSuggestionProvider;
+import com.keuin.kbackupfabric.event.OnPlayerConnect;
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.ui.KBCommands;
import com.keuin.kbackupfabric.util.DateUtil;
import com.keuin.kbackupfabric.util.PrintUtil;
@@ -41,6 +44,11 @@ public final class KBPluginEvents implements ModInitializer, ServerStartCallback
if (!(server instanceof MinecraftDedicatedServer))
throw new RuntimeException("KBackup is a server-side-only plugin. Please do not use it in client-side.");
+ // Bind fabric events
+
+ OnPlayerConnect.ON_PLAYER_CONNECT.register((connection, player)
+ -> NotificationManager.INSTANCE.notifyPlayer(DistinctNotifiable.fromServerPlayerEntity(player)));
+
// Initialize player manager reference
PrintUtil.setPlayerManager(server.getPlayerManager());