mirror of
https://github.com/PaperMC/Paper.git
synced 2025-04-13 17:32:45 +02:00
Add missing rarity method on ItemStack (#5594)
This commit is contained in:
parent
aeb6e7dd25
commit
f50171f3bb
26 changed files with 22 additions and 2 deletions
Spigot-API-Patches
Spigot-Server-Patches
0699-fix-cancelling-block-falling-causing-client-desync.patch0700-Expose-protocol-version.patch0701-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch0702-Enhance-console-tab-completions-for-brigadier-comman.patch0703-Fix-PlayerItemConsumeEvent-cancelling-properly.patch0704-Add-bypass-host-check.patch0705-don-t-throw-when-loading-invalid-TEs.patch0706-Set-area-affect-cloud-rotation.patch0707-add-isDeeplySleeping-to-HumanEntity.patch0708-Fix-duplicating-give-items-on-item-drop-cancel.patch0709-add-consumeFuel-to-FurnaceBurnEvent.patch0710-add-get-set-drop-chance-to-EntityEquipment.patch0711-fix-PigZombieAngerEvent-cancellation.patch0712-Fix-checkReach-check-for-Shulker-boxes.patch0713-fix-PlayerItemHeldEvent-firing-twice.patch0714-Added-PlayerDeepSleepEvent.patch0715-More-World-API.patch0716-Added-PlayerBedFailEnterEvent.patch0717-Implement-methods-to-convert-between-Component-and-B.patch0718-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch0719-add-RespawnFlags-to-PlayerRespawnEvent.patch0720-Introduce-beacon-activation-deactivation-events.patch0721-Add-Channel-initialization-listeners.patch0722-Send-empty-commands-if-tab-completion-is-disabled.patch0723-Add-more-WanderingTrader-API.patch
|
@ -86,3 +86,23 @@ index fafc4d63b6202b00a133c50cd38dec54db9b3576..6db8c3bae9c9bb10eedf8102b3ac4c6e
|
|||
+ 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 58f99e3ebac9a01ebffe4d208e16cbee474d4aa3..3c64c6ef397af102a3e085fe6b77a888d5c3de84 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -842,5 +842,15 @@ 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
|
||||
}
|
||||
|
|
|
@ -46,10 +46,10 @@ index 62d8b53c024888aa43b8fddf8a475dfb8284a4cc..2a61c24dd26edf4c72e977c6024fe233
|
|||
this.die();
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
|
||||
index ac3709c8158d42ccafd457cfa44a16dc8c9eb949..d9765da72c614260fdba47e7d1add4145991f97c 100644
|
||||
index 3fdafc0ff0c4148ec844dbdc1455d17cdcb4a75a..0d26250887f80d0c250bcd6bc7de303362427d3e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
|
||||
@@ -682,6 +682,7 @@ public abstract class BlockBase {
|
||||
@@ -683,6 +683,7 @@ public abstract class BlockBase {
|
||||
return this.getBlock().a(tag) && predicate.test(this);
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue