aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0623-Expose-protocol-version.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0623-Expose-protocol-version.patch')
-rw-r--r--patches/server/0623-Expose-protocol-version.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/server/0623-Expose-protocol-version.patch b/patches/server/0623-Expose-protocol-version.patch
new file mode 100644
index 0000000000..3f69974e93
--- /dev/null
+++ b/patches/server/0623-Expose-protocol-version.patch
@@ -0,0 +1,22 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nassim Jahnke <[email protected]>
+Date: Fri, 26 Mar 2021 11:23:17 +0100
+Subject: [PATCH] Expose protocol version
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+index 9cd69efe2923fd4c1680d386b8c16084359561c4..61a1992c3cd256c46f9a989bcb041f511f829378 100644
+--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+@@ -531,6 +531,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
+ public io.papermc.paper.inventory.ItemRarity getItemStackRarity(org.bukkit.inventory.ItemStack itemStack) {
+ return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()];
+ }
++
++ @Override
++ public int getProtocolVersion() {
++ return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion();
++ }
+ // Paper end
+
+ /**