From f50171f3bbdf3545bd32a012493af19e5296e0cd Mon Sep 17 00:00:00 2001 From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com> Date: Mon, 10 May 2021 00:25:35 -0700 Subject: [PATCH] Add missing rarity method on ItemStack (#5594) --- Spigot-API-Patches/0282-Item-Rarity-API.patch | 20 +++++++++++++++++++ ...block-falling-causing-client-desync.patch} | 4 ++-- ...tch => 0700-Expose-protocol-version.patch} | 0 ...nt-suggestion-tooltips-in-AsyncTabC.patch} | 0 ...ab-completions-for-brigadier-comman.patch} | 0 ...temConsumeEvent-cancelling-properly.patch} | 0 ...patch => 0704-Add-bypass-host-check.patch} | 0 ...on-t-throw-when-loading-invalid-TEs.patch} | 0 ...0706-Set-area-affect-cloud-rotation.patch} | 0 ...add-isDeeplySleeping-to-HumanEntity.patch} | 0 ...ting-give-items-on-item-drop-cancel.patch} | 0 ...add-consumeFuel-to-FurnaceBurnEvent.patch} | 0 ...-set-drop-chance-to-EntityEquipment.patch} | 0 ...ix-PigZombieAngerEvent-cancellation.patch} | 0 ...-checkReach-check-for-Shulker-boxes.patch} | 0 ...ix-PlayerItemHeldEvent-firing-twice.patch} | 0 ... => 0714-Added-PlayerDeepSleepEvent.patch} | 0 ...ld-API.patch => 0715-More-World-API.patch} | 0 ... 0716-Added-PlayerBedFailEnterEvent.patch} | 0 ...-to-convert-between-Component-and-B.patch} | 0 ...n-acting-as-a-bed-respawn-from-the-.patch} | 0 ...-RespawnFlags-to-PlayerRespawnEvent.patch} | 0 ...acon-activation-deactivation-events.patch} | 0 ...dd-Channel-initialization-listeners.patch} | 0 ...mands-if-tab-completion-is-disabled.patch} | 0 ...> 0723-Add-more-WanderingTrader-API.patch} | 0 26 files changed, 22 insertions(+), 2 deletions(-) rename Spigot-Server-Patches/{0698-fix-cancelling-block-falling-causing-client-desync.patch => 0699-fix-cancelling-block-falling-causing-client-desync.patch} (95%) rename Spigot-Server-Patches/{0699-Expose-protocol-version.patch => 0700-Expose-protocol-version.patch} (100%) rename Spigot-Server-Patches/{0700-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch => 0701-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch} (100%) rename Spigot-Server-Patches/{0701-Enhance-console-tab-completions-for-brigadier-comman.patch => 0702-Enhance-console-tab-completions-for-brigadier-comman.patch} (100%) rename Spigot-Server-Patches/{0702-Fix-PlayerItemConsumeEvent-cancelling-properly.patch => 0703-Fix-PlayerItemConsumeEvent-cancelling-properly.patch} (100%) rename Spigot-Server-Patches/{0703-Add-bypass-host-check.patch => 0704-Add-bypass-host-check.patch} (100%) rename Spigot-Server-Patches/{0704-don-t-throw-when-loading-invalid-TEs.patch => 0705-don-t-throw-when-loading-invalid-TEs.patch} (100%) rename Spigot-Server-Patches/{0705-Set-area-affect-cloud-rotation.patch => 0706-Set-area-affect-cloud-rotation.patch} (100%) rename Spigot-Server-Patches/{0706-add-isDeeplySleeping-to-HumanEntity.patch => 0707-add-isDeeplySleeping-to-HumanEntity.patch} (100%) rename Spigot-Server-Patches/{0707-Fix-duplicating-give-items-on-item-drop-cancel.patch => 0708-Fix-duplicating-give-items-on-item-drop-cancel.patch} (100%) rename Spigot-Server-Patches/{0708-add-consumeFuel-to-FurnaceBurnEvent.patch => 0709-add-consumeFuel-to-FurnaceBurnEvent.patch} (100%) rename Spigot-Server-Patches/{0709-add-get-set-drop-chance-to-EntityEquipment.patch => 0710-add-get-set-drop-chance-to-EntityEquipment.patch} (100%) rename Spigot-Server-Patches/{0710-fix-PigZombieAngerEvent-cancellation.patch => 0711-fix-PigZombieAngerEvent-cancellation.patch} (100%) rename Spigot-Server-Patches/{0711-Fix-checkReach-check-for-Shulker-boxes.patch => 0712-Fix-checkReach-check-for-Shulker-boxes.patch} (100%) rename Spigot-Server-Patches/{0712-fix-PlayerItemHeldEvent-firing-twice.patch => 0713-fix-PlayerItemHeldEvent-firing-twice.patch} (100%) rename Spigot-Server-Patches/{0713-Added-PlayerDeepSleepEvent.patch => 0714-Added-PlayerDeepSleepEvent.patch} (100%) rename Spigot-Server-Patches/{0714-More-World-API.patch => 0715-More-World-API.patch} (100%) rename Spigot-Server-Patches/{0715-Added-PlayerBedFailEnterEvent.patch => 0716-Added-PlayerBedFailEnterEvent.patch} (100%) rename Spigot-Server-Patches/{0716-Implement-methods-to-convert-between-Component-and-B.patch => 0717-Implement-methods-to-convert-between-Component-and-B.patch} (100%) rename Spigot-Server-Patches/{0717-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch => 0718-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch} (100%) rename Spigot-Server-Patches/{0718-add-RespawnFlags-to-PlayerRespawnEvent.patch => 0719-add-RespawnFlags-to-PlayerRespawnEvent.patch} (100%) rename Spigot-Server-Patches/{0719-Introduce-beacon-activation-deactivation-events.patch => 0720-Introduce-beacon-activation-deactivation-events.patch} (100%) rename Spigot-Server-Patches/{0720-Add-Channel-initialization-listeners.patch => 0721-Add-Channel-initialization-listeners.patch} (100%) rename Spigot-Server-Patches/{0721-Send-empty-commands-if-tab-completion-is-disabled.patch => 0722-Send-empty-commands-if-tab-completion-is-disabled.patch} (100%) rename Spigot-Server-Patches/{0722-Add-more-WanderingTrader-API.patch => 0723-Add-more-WanderingTrader-API.patch} (100%) diff --git a/Spigot-API-Patches/0282-Item-Rarity-API.patch b/Spigot-API-Patches/0282-Item-Rarity-API.patch index 12b81466e5..d796b5f349 100644 --- a/Spigot-API-Patches/0282-Item-Rarity-API.patch +++ b/Spigot-API-Patches/0282-Item-Rarity-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 + } diff --git a/Spigot-Server-Patches/0698-fix-cancelling-block-falling-causing-client-desync.patch b/Spigot-Server-Patches/0699-fix-cancelling-block-falling-causing-client-desync.patch similarity index 95% rename from Spigot-Server-Patches/0698-fix-cancelling-block-falling-causing-client-desync.patch rename to Spigot-Server-Patches/0699-fix-cancelling-block-falling-causing-client-desync.patch index 132c6ed69e..099ef07a97 100644 --- a/Spigot-Server-Patches/0698-fix-cancelling-block-falling-causing-client-desync.patch +++ b/Spigot-Server-Patches/0699-fix-cancelling-block-falling-causing-client-desync.patch @@ -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); } diff --git a/Spigot-Server-Patches/0699-Expose-protocol-version.patch b/Spigot-Server-Patches/0700-Expose-protocol-version.patch similarity index 100% rename from Spigot-Server-Patches/0699-Expose-protocol-version.patch rename to Spigot-Server-Patches/0700-Expose-protocol-version.patch diff --git a/Spigot-Server-Patches/0700-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch b/Spigot-Server-Patches/0701-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch similarity index 100% rename from Spigot-Server-Patches/0700-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch rename to Spigot-Server-Patches/0701-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch diff --git a/Spigot-Server-Patches/0701-Enhance-console-tab-completions-for-brigadier-comman.patch b/Spigot-Server-Patches/0702-Enhance-console-tab-completions-for-brigadier-comman.patch similarity index 100% rename from Spigot-Server-Patches/0701-Enhance-console-tab-completions-for-brigadier-comman.patch rename to Spigot-Server-Patches/0702-Enhance-console-tab-completions-for-brigadier-comman.patch diff --git a/Spigot-Server-Patches/0702-Fix-PlayerItemConsumeEvent-cancelling-properly.patch b/Spigot-Server-Patches/0703-Fix-PlayerItemConsumeEvent-cancelling-properly.patch similarity index 100% rename from Spigot-Server-Patches/0702-Fix-PlayerItemConsumeEvent-cancelling-properly.patch rename to Spigot-Server-Patches/0703-Fix-PlayerItemConsumeEvent-cancelling-properly.patch diff --git a/Spigot-Server-Patches/0703-Add-bypass-host-check.patch b/Spigot-Server-Patches/0704-Add-bypass-host-check.patch similarity index 100% rename from Spigot-Server-Patches/0703-Add-bypass-host-check.patch rename to Spigot-Server-Patches/0704-Add-bypass-host-check.patch diff --git a/Spigot-Server-Patches/0704-don-t-throw-when-loading-invalid-TEs.patch b/Spigot-Server-Patches/0705-don-t-throw-when-loading-invalid-TEs.patch similarity index 100% rename from Spigot-Server-Patches/0704-don-t-throw-when-loading-invalid-TEs.patch rename to Spigot-Server-Patches/0705-don-t-throw-when-loading-invalid-TEs.patch diff --git a/Spigot-Server-Patches/0705-Set-area-affect-cloud-rotation.patch b/Spigot-Server-Patches/0706-Set-area-affect-cloud-rotation.patch similarity index 100% rename from Spigot-Server-Patches/0705-Set-area-affect-cloud-rotation.patch rename to Spigot-Server-Patches/0706-Set-area-affect-cloud-rotation.patch diff --git a/Spigot-Server-Patches/0706-add-isDeeplySleeping-to-HumanEntity.patch b/Spigot-Server-Patches/0707-add-isDeeplySleeping-to-HumanEntity.patch similarity index 100% rename from Spigot-Server-Patches/0706-add-isDeeplySleeping-to-HumanEntity.patch rename to Spigot-Server-Patches/0707-add-isDeeplySleeping-to-HumanEntity.patch diff --git a/Spigot-Server-Patches/0707-Fix-duplicating-give-items-on-item-drop-cancel.patch b/Spigot-Server-Patches/0708-Fix-duplicating-give-items-on-item-drop-cancel.patch similarity index 100% rename from Spigot-Server-Patches/0707-Fix-duplicating-give-items-on-item-drop-cancel.patch rename to Spigot-Server-Patches/0708-Fix-duplicating-give-items-on-item-drop-cancel.patch diff --git a/Spigot-Server-Patches/0708-add-consumeFuel-to-FurnaceBurnEvent.patch b/Spigot-Server-Patches/0709-add-consumeFuel-to-FurnaceBurnEvent.patch similarity index 100% rename from Spigot-Server-Patches/0708-add-consumeFuel-to-FurnaceBurnEvent.patch rename to Spigot-Server-Patches/0709-add-consumeFuel-to-FurnaceBurnEvent.patch diff --git a/Spigot-Server-Patches/0709-add-get-set-drop-chance-to-EntityEquipment.patch b/Spigot-Server-Patches/0710-add-get-set-drop-chance-to-EntityEquipment.patch similarity index 100% rename from Spigot-Server-Patches/0709-add-get-set-drop-chance-to-EntityEquipment.patch rename to Spigot-Server-Patches/0710-add-get-set-drop-chance-to-EntityEquipment.patch diff --git a/Spigot-Server-Patches/0710-fix-PigZombieAngerEvent-cancellation.patch b/Spigot-Server-Patches/0711-fix-PigZombieAngerEvent-cancellation.patch similarity index 100% rename from Spigot-Server-Patches/0710-fix-PigZombieAngerEvent-cancellation.patch rename to Spigot-Server-Patches/0711-fix-PigZombieAngerEvent-cancellation.patch diff --git a/Spigot-Server-Patches/0711-Fix-checkReach-check-for-Shulker-boxes.patch b/Spigot-Server-Patches/0712-Fix-checkReach-check-for-Shulker-boxes.patch similarity index 100% rename from Spigot-Server-Patches/0711-Fix-checkReach-check-for-Shulker-boxes.patch rename to Spigot-Server-Patches/0712-Fix-checkReach-check-for-Shulker-boxes.patch diff --git a/Spigot-Server-Patches/0712-fix-PlayerItemHeldEvent-firing-twice.patch b/Spigot-Server-Patches/0713-fix-PlayerItemHeldEvent-firing-twice.patch similarity index 100% rename from Spigot-Server-Patches/0712-fix-PlayerItemHeldEvent-firing-twice.patch rename to Spigot-Server-Patches/0713-fix-PlayerItemHeldEvent-firing-twice.patch diff --git a/Spigot-Server-Patches/0713-Added-PlayerDeepSleepEvent.patch b/Spigot-Server-Patches/0714-Added-PlayerDeepSleepEvent.patch similarity index 100% rename from Spigot-Server-Patches/0713-Added-PlayerDeepSleepEvent.patch rename to Spigot-Server-Patches/0714-Added-PlayerDeepSleepEvent.patch diff --git a/Spigot-Server-Patches/0714-More-World-API.patch b/Spigot-Server-Patches/0715-More-World-API.patch similarity index 100% rename from Spigot-Server-Patches/0714-More-World-API.patch rename to Spigot-Server-Patches/0715-More-World-API.patch diff --git a/Spigot-Server-Patches/0715-Added-PlayerBedFailEnterEvent.patch b/Spigot-Server-Patches/0716-Added-PlayerBedFailEnterEvent.patch similarity index 100% rename from Spigot-Server-Patches/0715-Added-PlayerBedFailEnterEvent.patch rename to Spigot-Server-Patches/0716-Added-PlayerBedFailEnterEvent.patch diff --git a/Spigot-Server-Patches/0716-Implement-methods-to-convert-between-Component-and-B.patch b/Spigot-Server-Patches/0717-Implement-methods-to-convert-between-Component-and-B.patch similarity index 100% rename from Spigot-Server-Patches/0716-Implement-methods-to-convert-between-Component-and-B.patch rename to Spigot-Server-Patches/0717-Implement-methods-to-convert-between-Component-and-B.patch diff --git a/Spigot-Server-Patches/0717-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch b/Spigot-Server-Patches/0718-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch similarity index 100% rename from Spigot-Server-Patches/0717-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch rename to Spigot-Server-Patches/0718-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch diff --git a/Spigot-Server-Patches/0718-add-RespawnFlags-to-PlayerRespawnEvent.patch b/Spigot-Server-Patches/0719-add-RespawnFlags-to-PlayerRespawnEvent.patch similarity index 100% rename from Spigot-Server-Patches/0718-add-RespawnFlags-to-PlayerRespawnEvent.patch rename to Spigot-Server-Patches/0719-add-RespawnFlags-to-PlayerRespawnEvent.patch diff --git a/Spigot-Server-Patches/0719-Introduce-beacon-activation-deactivation-events.patch b/Spigot-Server-Patches/0720-Introduce-beacon-activation-deactivation-events.patch similarity index 100% rename from Spigot-Server-Patches/0719-Introduce-beacon-activation-deactivation-events.patch rename to Spigot-Server-Patches/0720-Introduce-beacon-activation-deactivation-events.patch diff --git a/Spigot-Server-Patches/0720-Add-Channel-initialization-listeners.patch b/Spigot-Server-Patches/0721-Add-Channel-initialization-listeners.patch similarity index 100% rename from Spigot-Server-Patches/0720-Add-Channel-initialization-listeners.patch rename to Spigot-Server-Patches/0721-Add-Channel-initialization-listeners.patch diff --git a/Spigot-Server-Patches/0721-Send-empty-commands-if-tab-completion-is-disabled.patch b/Spigot-Server-Patches/0722-Send-empty-commands-if-tab-completion-is-disabled.patch similarity index 100% rename from Spigot-Server-Patches/0721-Send-empty-commands-if-tab-completion-is-disabled.patch rename to Spigot-Server-Patches/0722-Send-empty-commands-if-tab-completion-is-disabled.patch diff --git a/Spigot-Server-Patches/0722-Add-more-WanderingTrader-API.patch b/Spigot-Server-Patches/0723-Add-more-WanderingTrader-API.patch similarity index 100% rename from Spigot-Server-Patches/0722-Add-more-WanderingTrader-API.patch rename to Spigot-Server-Patches/0723-Add-more-WanderingTrader-API.patch