[ci skip] Move logic in our patches to ItemType/BlockType (#10772)

This commit is contained in:
Jake Potrebic
2024-05-23 10:32:02 -07:00
parent c7e42591dd
commit 98853ee548
12 changed files with 177 additions and 77 deletions

View File

@@ -47,10 +47,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
return Bukkit.getUnsafe().getBlockTranslationKey(this);
}
}
+
// Paper end - add Translatable
+ // Paper start - item rarity API
+ /**
+ * Returns the item rarity for the item. The Material <b>MUST</b> be an Item not a block.
+ * Use {@link #isItem()} before this.
@@ -63,9 +63,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public io.papermc.paper.inventory.ItemRarity getItemRarity() {
+ return new org.bukkit.inventory.ItemStack(this).getRarity();
+ }
// Paper end
+ // Paper end - item rarity API
+
/**
* Do not use for any reason.
*
diff --git a/src/main/java/org/bukkit/inventory/ItemRarity.java b/src/main/java/org/bukkit/inventory/ItemRarity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/ItemRarity.java