summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2011-01-16 16:10:22 +0100
committerErik Broes <erikbroes@grum.nl>2011-01-16 16:10:32 +0100
commit8a9d21c7f333794d977c812bb0fed9cf2447c287 (patch)
treeec7b6c0d0b02559dfe18c0e537df1e5f78af7f15 /src
parentd41105f3afc1551250c6f8074ef833014bbd45f7 (diff)
downloadbukkit-8a9d21c7f333794d977c812bb0fed9cf2447c287.tar
bukkit-8a9d21c7f333794d977c812bb0fed9cf2447c287.tar.gz
bukkit-8a9d21c7f333794d977c812bb0fed9cf2447c287.tar.lz
bukkit-8a9d21c7f333794d977c812bb0fed9cf2447c287.tar.xz
bukkit-8a9d21c7f333794d977c812bb0fed9cf2447c287.zip
Added Invenrory.removeItem(ItemStack...)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/inventory/Inventory.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java
index b05acf96..e4bc9afd 100644
--- a/src/main/java/org/bukkit/inventory/Inventory.java
+++ b/src/main/java/org/bukkit/inventory/Inventory.java
@@ -38,7 +38,10 @@ public interface Inventory {
public void setItem(int index, ItemStack item);
/**
- * Stores the given ItemStacks in the inventory
+ * Stores the given ItemStacks in the inventory.
+ *
+ * This will try to fill existing stacks and empty slots as good as it can.
+ * It will return a HashMap of what it couldn't fit.
*
* @param items The ItemStacks to add
* @return
@@ -46,6 +49,17 @@ public interface Inventory {
public HashMap<Integer, ItemStack> addItem(ItemStack... items);
/**
+ * Removes the given ItemStacks from the inventory.
+ *
+ * It will try to remove 'as much as possible' from the types and amounts you
+ * give as arguments. It will return a HashMap of what it couldn't remove.
+ *
+ * @param items The ItemStacks to remove
+ * @return
+ */
+ public HashMap<Integer, ItemStack> removeItem(ItemStack... items);
+
+ /**
* Get all ItemStacks from the inventory
*
* @return All the ItemStacks from all slots