summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2021-01-29 18:54:53 +0800
committerkeuin <[email protected]>2021-01-29 18:54:53 +0800
commit602fb9e88685041abac73f868cb697123e15865c (patch)
treefab97907433b15ab88a55af03c88f6f22ce90676 /src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java
parentb0208136e0dab098d8270b56b65521e13ff3d732 (diff)
Add Op login hint in the next start after restoring
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());