Waterfall/BungeeCord-Patches/0061-Add-protocol-version-to-packet-not-found-message.patch
LinsaFTW 1efb2d439e
Updated Upstream (BungeeCord) (#844)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
d0fa62d4 Minecraft 24w06a support
464ed018 Improve cookie support during login
eda268b4 Fix 24w05b spectate packet ID
3e100752 #3612: Error when disconnecting player on PostLoginEvent
b52b1469 Add PendingConnection#isTransferred API method
94d5b0d0 Minecraft 24w05b support
c3f228f6 #3610, 3611: inverted isEmpty method on ComponentStyle
02c5c1ee #3602: Minecraft 24w04a support
c69acf72 Add JetBrains java-annotations
a1cd6943 Bump version to 1.20-R0.3-SNAPSHOT
3e2bc8e2 Release 1.20-R0.2
ad7163d2 #3600: Bump io.netty:netty-bom from 4.1.104.Final to 4.1.106.Final
2024-02-24 17:21:31 +00:00

39 lines
1.7 KiB
Diff

From 3251af3cd2f65b41d5142959d55cde21ce2769d4 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 12 Jun 2022 06:45:54 +0100
Subject: [PATCH] Add protocol version to packet not found message
Also avoids a double get, but, this is probably trivial
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
index c83b91af..37142e26 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
@@ -2,6 +2,8 @@ package net.md_5.bungee.protocol;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
+
+import gnu.trove.impl.Constants;
import gnu.trove.map.TIntObjectMap;
import gnu.trove.map.TObjectIntMap;
import gnu.trove.map.hash.TIntObjectHashMap;
@@ -932,9 +934,12 @@ public enum Protocol
{
throw new BadPacketException( "Unsupported protocol version" );
}
- Preconditions.checkArgument( protocolData.packetMap.containsKey( packet ), "Cannot get ID for packet %s in phase %s with direction %s", packet, protocolPhase, direction );
+ // Waterfall start
+ final int packetId = protocolData.packetMap.get(packet);
+ Preconditions.checkArgument( packetId >= 0, "Cannot get ID for packet %s in phase %s with direction %s for protocol version %s", packet, protocolPhase, direction, version ); // Waterfall - add version
- return protocolData.packetMap.get( packet );
+ return packetId;
+ // Waterfall end
}
}
}
--
2.43.0.windows.1