aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-API-Patches-Unmapped/0143-Inventory-removeItemAnySlot.patch
diff options
context:
space:
mode:
authorKyle Wood <[email protected]>2021-04-24 17:01:33 -0500
committerKyle Wood <[email protected]>2021-04-25 18:37:43 -0500
commit3093b81fee3064603c368ab934eddf66ce304433 (patch)
treecb99f05b5f31de92c41af4cc40b4bef5f3cbf573 /Spigot-API-Patches-Unmapped/0143-Inventory-removeItemAnySlot.patch
parent1af696a05d21cbdd7b5a7170f95598c013257588 (diff)
downloadPaper-3093b81fee3064603c368ab934eddf66ce304433.tar.gz
Paper-3093b81fee3064603c368ab934eddf66ce304433.zip
Move patches
Diffstat (limited to 'Spigot-API-Patches-Unmapped/0143-Inventory-removeItemAnySlot.patch')
-rw-r--r--Spigot-API-Patches-Unmapped/0143-Inventory-removeItemAnySlot.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/Spigot-API-Patches-Unmapped/0143-Inventory-removeItemAnySlot.patch b/Spigot-API-Patches-Unmapped/0143-Inventory-removeItemAnySlot.patch
new file mode 100644
index 0000000000..4d6f2e9e57
--- /dev/null
+++ b/Spigot-API-Patches-Unmapped/0143-Inventory-removeItemAnySlot.patch
@@ -0,0 +1,45 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zach Brown <[email protected]>
+Date: Tue, 28 Aug 2018 23:04:06 -0400
+Subject: [PATCH] Inventory#removeItemAnySlot
+
+
+diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java
+index 5576a6a8df8c95164bf2dde45d756ce8b7ec957a..9c6a5bdac8c3ab682bbfae04ff24b76a62bc2883 100644
+--- a/src/main/java/org/bukkit/inventory/Inventory.java
++++ b/src/main/java/org/bukkit/inventory/Inventory.java
+@@ -125,6 +125,34 @@ public interface Inventory extends Iterable<ItemStack> {
+ @NotNull
+ public HashMap<Integer, ItemStack> removeItem(@NotNull ItemStack... items) throws IllegalArgumentException;
+
++ // Paper start
++ /**
++ * Searches all possible inventory slots in order to remove the given ItemStacks.
++ * <p>
++ * Similar to {@link Inventory#removeItem(ItemStack...)} in behavior, except this
++ * method will check all possible slots in the inventory, rather than just the main
++ * storage contents.
++ * <p>
++ * It will try to remove 'as much as possible' from the types and amounts
++ * you give as arguments.
++ * <p>
++ * The returned HashMap contains what it couldn't remove, where the key is
++ * the index of the parameter, and the value is the ItemStack at that
++ * index of the varargs parameter. If all the given ItemStacks are
++ * removed, it will return an empty HashMap.
++ * <p>
++ * It is known that in some implementations this method will also set the
++ * inputted argument amount to the number of that item not removed from
++ * slots.
++ *
++ * @param items The ItemStacks to remove
++ * @return A HashMap containing items that couldn't be removed.
++ * @throws IllegalArgumentException if items is null
++ */
++ @NotNull
++ public HashMap<Integer, ItemStack> removeItemAnySlot(@NotNull ItemStack... items) throws IllegalArgumentException;
++ // Paper end
++
+ /**
+ * Returns all ItemStacks from the inventory
+ *