mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Fix sending disconnect packet in phases where it doesn't exist
This commit is contained in:
parent
25b99bc93a
commit
3bb51e10ab
@ -0,0 +1,21 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Shane Freeder <theboyetronic@gmail.com>
|
||||||
|
Date: Thu, 30 May 2024 18:46:15 +0100
|
||||||
|
Subject: [PATCH] Fix sending disconnect packet in phases where it doesn't
|
||||||
|
exist
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||||
|
@@ -0,0 +0,0 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||||
|
if (player != null) player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.ERRONEOUS_STATE; // Paper - Add API for quit reason
|
||||||
|
if (flag) {
|
||||||
|
Connection.LOGGER.debug("Failed to sent packet", throwable);
|
||||||
|
- if (this.getSending() == PacketFlow.CLIENTBOUND) {
|
||||||
|
+ boolean doesDisconnectExist = this.packetListener.protocol() != ConnectionProtocol.STATUS && this.packetListener.protocol() != ConnectionProtocol.HANDSHAKING; // Paper
|
||||||
|
+ if (this.getSending() == PacketFlow.CLIENTBOUND && doesDisconnectExist) { // Paper
|
||||||
|
Packet<?> packet = this.sendLoginDisconnect ? new ClientboundLoginDisconnectPacket(ichatmutablecomponent) : new ClientboundDisconnectPacket(ichatmutablecomponent);
|
||||||
|
|
||||||
|
this.send((Packet) packet, PacketSendListener.thenRun(() -> {
|
Loading…
Reference in New Issue
Block a user