From 1b2e403319280ecab18f15f3d38a371a584876e9 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 15 Jan 2011 21:58:47 +0100 Subject: [PATCH] Added Inventory.clear(|index) Inventory.remove(typeId|Material|ItemStack) By: Erik Broes --- .../src/main/java/org/bukkit/Inventory.java | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/Inventory.java b/paper-api/src/main/java/org/bukkit/Inventory.java index a3233694df..6a51c6d2be 100644 --- a/paper-api/src/main/java/org/bukkit/Inventory.java +++ b/paper-api/src/main/java/org/bukkit/Inventory.java @@ -132,4 +132,38 @@ public interface Inventory { * @return The first empty Slot found. */ public int firstEmpty(); -} \ No newline at end of file + + /** + * Remove all stacks in the inventory matching the given materialId. + * + * @param materialId The material to remove + */ + public void remove(int materialId); + + /** + * Remove all stacks in the inventory matching the given material. + * + * @param material The material to remove + */ + public void remove(Material material); + + /** + * Remove all stacks in the inventory matching the given stack. + * This will only match a slot if both the type and the amount of the stack match + * + * @param item The ItemStack to match against + */ + public void remove(ItemStack item); + + /** + * Clear out a particular slot in the index + * + * @param index The index to empty. + */ + public void clear(int index); + + /** + * Clear out the whole index + */ + public void clear(); +}