mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-30 04:01:55 +01:00
parent
7a227d7d3b
commit
8ddb8ec3a5
32
Spigot-API-Patches/ItemStack-editMeta.patch
Normal file
32
Spigot-API-Patches/ItemStack-editMeta.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Riley Park <rileysebastianpark@gmail.com>
|
||||
Date: Sun, 23 May 2021 05:04:28 -0700
|
||||
Subject: [PATCH] ItemStack#editMeta
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
return result.ensureServerConversions(); // Paper
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Edits the {@link ItemMeta} of this stack.
|
||||
+ *
|
||||
+ * @param consumer the meta consumer
|
||||
+ */
|
||||
+ public void editMeta(final @NotNull java.util.function.Consumer<? super ItemMeta> consumer) {
|
||||
+ final ItemMeta meta = this.getItemMeta();
|
||||
+ if (meta != null) {
|
||||
+ consumer.accept(meta);
|
||||
+ this.setItemMeta(meta);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Get a copy of this ItemStack's {@link ItemMeta}.
|
||||
*
|
Loading…
Reference in New Issue
Block a user