diff --git a/src/main/java/carpet/patches/EntityPlayerMPFake.java b/src/main/java/carpet/patches/EntityPlayerMPFake.java index 3ac3f4e8..7ef72d9f 100644 --- a/src/main/java/carpet/patches/EntityPlayerMPFake.java +++ b/src/main/java/carpet/patches/EntityPlayerMPFake.java @@ -5,6 +5,7 @@ import com.mojang.authlib.GameProfile; import net.minecraft.core.BlockPos; import net.minecraft.core.UUIDUtil; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.contents.TranslatableContents; import net.minecraft.network.protocol.PacketFlow; import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket; import net.minecraft.network.protocol.game.ClientboundRotateHeadPacket; @@ -132,9 +133,14 @@ public class EntityPlayerMPFake extends ServerPlayer public void kill(Component reason) { shakeOff(); - this.server.tell(new TickTask(this.server.getTickCount(), () -> { + + if (reason.getContents() instanceof TranslatableContents text && text.getKey().equals("multiplayer.disconnect.duplicate_login")) { this.connection.onDisconnect(reason); - })); + } else { + this.server.tell(new TickTask(this.server.getTickCount(), () -> { + this.connection.onDisconnect(reason); + })); + } } @Override