mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Add missing rarity method on ItemStack (#5594)
This commit is contained in:
parent
4d8954ef25
commit
784728bcc7
1 changed files with 20 additions and 0 deletions
|
@ -86,3 +86,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ public io.papermc.paper.inventory.ItemRarity getItemStackRarity(ItemStack itemStack);
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
ItemMeta itemMeta = getItemMeta();
|
||||
return itemMeta != null && itemMeta.hasItemFlag(flag);
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the item rarity of the itemstack. The rarity can change based on enchantements.
|
||||
+ *
|
||||
+ * @return the itemstack rarity
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public io.papermc.paper.inventory.ItemRarity getRarity() {
|
||||
+ return Bukkit.getUnsafe().getItemStackRarity(this);
|
||||
+ }
|
||||
// Paper end
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue