diff options
author | Keuin <[email protected]> | 2021-01-29 18:54:53 +0800 |
---|---|---|
committer | keuin <[email protected]> | 2021-01-29 18:54:53 +0800 |
commit | 602fb9e88685041abac73f868cb697123e15865c (patch) | |
tree | fab97907433b15ab88a55af03c88f6f22ce90676 /src/main/java/com/keuin/kbackupfabric/event/OnPlayerConnect.java | |
parent | b0208136e0dab098d8270b56b65521e13ff3d732 (diff) |
Add Op login hint in the next start after restoring
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/event/OnPlayerConnect.java')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/event/OnPlayerConnect.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/event/OnPlayerConnect.java b/src/main/java/com/keuin/kbackupfabric/event/OnPlayerConnect.java new file mode 100644 index 0000000..490249b --- /dev/null +++ b/src/main/java/com/keuin/kbackupfabric/event/OnPlayerConnect.java @@ -0,0 +1,18 @@ +package com.keuin.kbackupfabric.event; + +import net.fabricmc.fabric.api.event.Event; +import net.fabricmc.fabric.api.event.EventFactory; +import net.minecraft.network.ClientConnection; +import net.minecraft.server.network.ServerPlayerEntity; + +public class OnPlayerConnect { + public interface PlayerConnectEventCallback { + void onPlayerConnect(ClientConnection connection, ServerPlayerEntity player); + } + + public static final Event<PlayerConnectEventCallback> ON_PLAYER_CONNECT = EventFactory.createArrayBacked(PlayerConnectEventCallback.class, callbacks -> (conn, player) -> { + for (PlayerConnectEventCallback callback : callbacks) { + callback.onPlayerConnect(conn, player); + } + }); +} |