mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 11:25:55 +03:00
26 lines
1.3 KiB
Diff
26 lines
1.3 KiB
Diff
--- ../src-base/minecraft/net/minecraft/network/NettyPacketEncoder.java
|
|
+++ ../src-work/minecraft/net/minecraft/network/NettyPacketEncoder.java
|
|
@@ -37,6 +37,13 @@
|
|
LOGGER.debug(RECEIVED_PACKET_MARKER, "OUT: [{}:{}] {}", p_encode_1_.channel().attr(NetworkManager.PROTOCOL_ATTRIBUTE_KEY).get(), integer, p_encode_2_.getClass().getName());
|
|
}
|
|
|
|
+ // CatServer start - Forge set the state is PLAY, but the LOGIN packet hasn't encoded.
|
|
+ if (integer == null && (integer = EnumConnectionState.LOGIN.getPacketId(this.direction, p_encode_2_)) != null)
|
|
+ {
|
|
+ LOGGER.debug("Current state is {}, but send packet {}", enumconnectionstate, p_encode_2_.getClass().getSimpleName());
|
|
+ }
|
|
+ // CatServer end
|
|
+
|
|
if (integer == null)
|
|
{
|
|
throw new IOException("Can't serialize unregistered packet");
|
|
@@ -52,7 +59,7 @@
|
|
}
|
|
catch (Throwable throwable)
|
|
{
|
|
- LOGGER.error(throwable);
|
|
+ throw throwable; // Forge: throw this instead of logging it, to prevent corrupt packets from being sent to the client where they are much harder to debug.
|
|
}
|
|
}
|
|
}
|