Waterfall/BungeeCord-Patches/0061-Add-protocol-version-to-packet-not-found-message.patch
Noah van der Aa 24b7e51ed5
Updated Upstream (BungeeCord) (#834)
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:
8ce7a7f8 Minecraft 1.20.3 support
e1462ccd Minecraft 1.20.3-rc1 support
70f346c1 Fix extra write in ScoreboardScore packet
197bf13a Minecraft 1.20.3-pre2 support
2023-12-05 18:31:22 +00:00

39 lines
1.7 KiB
Diff

From b13c9df810ca47a2d64848f3b03f1048819df913 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 b55ebede..27d4c2c4 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;
@@ -851,9 +853,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.39.2