aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0647-Expose-protocol-version.patch
blob: dbf1a7b691c3417bc1495001478e0004092f2c1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kennytv <jahnke.nassim@gmail.com>
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 8ff6d0deb3532515cecdab1f50b8558ef7603f53..719a4811d9a9a754f7893c595d09187c494bbbae 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -483,6 +483,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
 
     /**