summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/mixin
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/mixin
parentb0208136e0dab098d8270b56b65521e13ff3d732 (diff)
Add Op login hint in the next start after restoring
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/mixin')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/mixin/PlayerManagerMixin.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/mixin/PlayerManagerMixin.java b/src/main/java/com/keuin/kbackupfabric/mixin/PlayerManagerMixin.java
new file mode 100644
index 0000000..eab87e1
--- /dev/null
+++ b/src/main/java/com/keuin/kbackupfabric/mixin/PlayerManagerMixin.java
@@ -0,0 +1,18 @@
+package com.keuin.kbackupfabric.mixin;
+
+import com.keuin.kbackupfabric.event.OnPlayerConnect;
+import net.minecraft.network.ClientConnection;
+import net.minecraft.server.PlayerManager;
+import net.minecraft.server.network.ServerPlayerEntity;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+
+@Mixin(PlayerManager.class)
+public class PlayerManagerMixin {
+ @Inject(method = "onPlayerConnect", at = @At("TAIL"))
+ public void onPlayerConnect(ClientConnection connection, ServerPlayerEntity player, CallbackInfo ci) {
+ OnPlayerConnect.ON_PLAYER_CONNECT.invoker().onPlayerConnect(connection, player);
+ }
+}