From 0edaf770eaf54f6b90108536b658ce5b42f5c5ee Mon Sep 17 00:00:00 2001 From: Riley Park Date: Sun, 23 May 2021 12:32:43 -0700 Subject: [PATCH] Change return type of ItemStack#editMeta to allow checking for successful vs non-successful edits --- Spigot-API-Patches/ItemStack-editMeta.patch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Spigot-API-Patches/ItemStack-editMeta.patch b/Spigot-API-Patches/ItemStack-editMeta.patch index 4cbb417c97..9ba99464e7 100644 --- a/Spigot-API-Patches/ItemStack-editMeta.patch +++ b/Spigot-API-Patches/ItemStack-editMeta.patch @@ -17,13 +17,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * Edits the {@link ItemMeta} of this stack. + * + * @param consumer the meta consumer ++ * @return {@code true} if the edit was successful, {@code false} otherwise + */ -+ public void editMeta(final @NotNull java.util.function.Consumer consumer) { ++ public boolean editMeta(final @NotNull java.util.function.Consumer consumer) { + final ItemMeta meta = this.getItemMeta(); + if (meta != null) { + consumer.accept(meta); + this.setItemMeta(meta); ++ return true; + } ++ return false; + } + // Paper end +