deprecate our ItemRarity API

This commit is contained in:
Jake Potrebic
2024-04-26 16:43:59 -07:00
parent d93d74a7d5
commit 5a55c71491
9 changed files with 67 additions and 109 deletions

View File

@@ -9,9 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- 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 server's protocol version
*/
public io.papermc.paper.inventory.ItemRarity getItemStackRarity(ItemStack itemStack);
int getProtocolVersion();
+
+ /**
+ * Checks if an itemstack can be repaired with another itemstack.
+ * Returns false if either argument's type is not an item ({@link Material#isItem()}).
@@ -21,17 +22,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @return true if valid repair, false if not
+ */
+ public boolean isValidRepairItemStack(@org.jetbrains.annotations.NotNull ItemStack itemToBeRepaired, @org.jetbrains.annotations.NotNull ItemStack repairMaterial);
+
/**
* Returns the server's protocol version.
*
// 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, Translat
public io.papermc.paper.inventory.ItemRarity getRarity() {
return Bukkit.getUnsafe().getItemStackRarity(this);
return io.papermc.paper.inventory.ItemRarity.valueOf(this.getItemMeta().getRarity().name());
}
+
+ /**