From 37d171544a3c788e5ae7ec0596e720577d02dc13 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 21 Feb 2023 09:35:25 -0800 Subject: [PATCH] Further clarify functionality of damageItemStack methods (#8878) --- patches/api/ItemStack-damage-API.patch | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/patches/api/ItemStack-damage-API.patch b/patches/api/ItemStack-damage-API.patch index c69417f0ca..d6d843b5a2 100644 --- a/patches/api/ItemStack-damage-API.patch +++ b/patches/api/ItemStack-damage-API.patch @@ -38,21 +38,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + void broadcastSlotBreak(org.bukkit.inventory.@NotNull EquipmentSlot slot, @NotNull Collection players); + + /** -+ * Damages this itemstack by the specified amount. This -+ * runs all logic associated with damaging an itemstack like -+ * events and stat changes. ++ * Damages the itemstack in this slot by the specified amount. ++ *

++ * This runs all logic associated with damaging an itemstack like ++ * gamemode and enchantment checks, events, stat changes, and advancement ++ * triggers. + * + * @param stack the itemstack to damage + * @param amount the amount of damage to do -+ * @return the damaged itemstack, or an empty stack if it broke. It may be the same instance as the stack passed it, but it may not. ++ * @return the damaged itemstack, or an empty stack if it broke. There are no ++ * guarantees the returned itemstack is the same instance + */ + @NotNull ItemStack damageItemStack(@NotNull ItemStack stack, int amount); + + /** + * Damages the itemstack in this slot by the specified amount. ++ *

+ * This runs all logic associated with damaging an itemstack like -+ * events, stat changes, and notifying clients to play -+ * break animations. ++ * gamemode and enchantment checks, events, stat changes, advancement ++ * triggers, and notifying clients to play break animations. + * + * @param slot the slot of the stack to damage + * @param amount the amount of damage to do