From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke 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 7807d0bf54cf55703a96ff5d55f335ff786048b7..e71b4d76971a195224b74ffae9b235a1f47b445e 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -575,6 +575,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()[((org.bukkit.craftbukkit.inventory.CraftItemType)itemStack.getType()).getHandle().getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()]; } + + @Override + public int getProtocolVersion() { + return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion(); + } // Paper end /**