From 20c4ee731d1a0f368c3716396ef26800d09deb06 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 23 May 2024 21:46:00 -0300 Subject: [PATCH] revert: Fallback to the HANDSHAKING protocol if no packet type is found in the registry (fixes https://github.com/dmulloy2/ProtocolLib/issues/2601) This reverts commit 564349c914d5204526f129506a26734dc7c0cbda. --- .../injector/netty/manager/NetworkManagerInjector.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/java/com/comphenix/protocol/injector/netty/manager/NetworkManagerInjector.java b/src/main/java/com/comphenix/protocol/injector/netty/manager/NetworkManagerInjector.java index d6cbbf6a..f5758cde 100644 --- a/src/main/java/com/comphenix/protocol/injector/netty/manager/NetworkManagerInjector.java +++ b/src/main/java/com/comphenix/protocol/injector/netty/manager/NetworkManagerInjector.java @@ -112,15 +112,7 @@ public PacketEvent onPacketReceiving(Injector injector, Object packet, NetworkMa if (marker != null || inboundListeners.contains(packetClass)) { // wrap the packet and construct the event PacketType.Protocol currentProtocol = injector.getCurrentProtocol(PacketType.Sender.CLIENT); - PacketType packetType = PacketRegistry.getPacketType(currentProtocol, packetClass); - - // if packet type could not be found, fallback to HANDSHAKING protocol - // temporary workaround for https://github.com/dmulloy2/ProtocolLib/issues/2601 - if (packetType == null) { - packetType = PacketRegistry.getPacketType(PacketType.Protocol.HANDSHAKING, packetClass); - } - - PacketContainer container = new PacketContainer(packetType, packet); + PacketContainer container = new PacketContainer(PacketRegistry.getPacketType(currentProtocol, packetClass), packet); PacketEvent packetEvent = PacketEvent.fromClient(this, container, marker, injector.getPlayer()); // post to all listeners, then return the packet event we constructed