Skip to content

Commit

Permalink
revert: Fallback to the HANDSHAKING protocol if no packet type is fou…
Browse files Browse the repository at this point in the history
…nd in the registry (fixes dmulloy2#2601)

This reverts commit 564349c.
  • Loading branch information
nickuc committed May 24, 2024
1 parent b0c4b7f commit 20c4ee7
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 20c4ee7

Please sign in to comment.