mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-17 02:34:30 +01:00
Expose server protocol version (#5416)
This commit is contained in:
parent
dcdfac1f8c
commit
6190c17845
2 changed files with 45 additions and 0 deletions
23
Spigot-API-Patches/Expose-protocol-version.patch
Normal file
23
Spigot-API-Patches/Expose-protocol-version.patch
Normal file
|
@ -0,0 +1,23 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nassim Jahnke <nassim@njahnke.dev>
|
||||
Date: Fri, 26 Mar 2021 11:23:27 +0100
|
||||
Subject: [PATCH] Expose protocol version
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -0,0 +0,0 @@ public interface UnsafeValues {
|
||||
* @return the itemstack rarity
|
||||
*/
|
||||
public io.papermc.paper.inventory.ItemRarity getItemStackRarity(ItemStack itemStack);
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the server's protocol version.
|
||||
+ *
|
||||
+ * @return the server's protocol version
|
||||
+ */
|
||||
+ int getProtocolVersion();
|
||||
// Paper end
|
||||
}
|
22
Spigot-Server-Patches/Expose-protocol-version.patch
Normal file
22
Spigot-Server-Patches/Expose-protocol-version.patch
Normal file
|
@ -0,0 +1,22 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nassim Jahnke <nassim@njahnke.dev>
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getItemStackRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()];
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public int getProtocolVersion() {
|
||||
+ return net.minecraft.SharedConstants.getGameVersion().getProtocolVersion();
|
||||
+ }
|
||||
+
|
||||
// Paper end
|
||||
|
||||
/**
|
Loading…
Add table
Reference in a new issue