diff options
author | Limb <ibelimb@gmail.com> | 2011-01-24 07:32:53 +0800 |
---|---|---|
committer | Warren <evilseph@unaligned.org> | 2011-02-04 04:06:04 +0800 |
commit | 2834a41f3a80cb00370d547576e8223417dd984e (patch) | |
tree | 82d7d9781eefe70ce42d48936a7a500690a21677 | |
parent | ef79a4d71649e60925e2df4d8132e1600fe2f354 (diff) | |
download | bukkit-2834a41f3a80cb00370d547576e8223417dd984e.tar bukkit-2834a41f3a80cb00370d547576e8223417dd984e.tar.gz bukkit-2834a41f3a80cb00370d547576e8223417dd984e.tar.lz bukkit-2834a41f3a80cb00370d547576e8223417dd984e.tar.xz bukkit-2834a41f3a80cb00370d547576e8223417dd984e.zip |
Implemented Inventory.contains with a minimum amount of item required. As per feature request #187
-rw-r--r-- | src/main/java/org/bukkit/inventory/Inventory.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java index e0b52562..01c9160c 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java @@ -97,6 +97,32 @@ public interface Inventory { * @return If any matching ItemStacks were found */ public boolean contains(ItemStack item); + + /** + * Check if the inventory contains any ItemStacks with the given materialId and at least the minimum amount specified + * + * @param materialId The materialId to check for + * @param amount The minimum amount to look for + * @return If any ItemStacks were found + */ + public boolean contains(int materialId, int amount); + + /** + * Check if the inventory contains any ItemStacks with the given material and at least the minimum amount specified + * + * @param material The material to check for + * @return If any ItemStacks were found + */ + public boolean contains(Material material, int amount); + + /** + * Check if the inventory contains any ItemStacks matching the given ItemStack and at least the minimum amount specified + * This will only match if both the type and the amount of the stack match + * + * @param item The ItemStack to match against + * @return If any matching ItemStacks were found + */ + public boolean contains(ItemStack item, int amount); /** * Find all slots in the inventory containing any ItemStacks with the given materialId |