From 027b85caf3def8c30ff70bc461878ff70c508415 Mon Sep 17 00:00:00 2001 From: Gergely Sarkozi Date: Sun, 30 May 2021 13:45:46 +0200 Subject: [PATCH] editMeta: tighten contract via docs (#5714) --- Spigot-API-Patches/ItemStack-editMeta.patch | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Spigot-API-Patches/ItemStack-editMeta.patch b/Spigot-API-Patches/ItemStack-editMeta.patch index 9ba99464e7..0df0b07da0 100644 --- a/Spigot-API-Patches/ItemStack-editMeta.patch +++ b/Spigot-API-Patches/ItemStack-editMeta.patch @@ -15,6 +15,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start + /** + * Edits the {@link ItemMeta} of this stack. ++ *

++ * The {@link java.util.function.Consumer} must only interact ++ * with this stack's {@link ItemMeta} through the provided {@link ItemMeta} instance. ++ * Calling this method or any other meta-related method of the {@link ItemStack} class ++ * (such as {@link #getItemMeta()}, {@link #addItemFlags(ItemFlag...)}, {@link #lore()}, etc.) ++ * from inside the consumer is disallowed and will produce undefined results or exceptions. ++ *

+ * + * @param consumer the meta consumer + * @return {@code true} if the edit was successful, {@code false} otherwise