summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md12
-rw-r--r--src/main/java/org/bukkit/inventory/Inventory.java26
2 files changed, 37 insertions, 1 deletions
diff --git a/README.md b/README.md
index ceac2540..a1551a4f 100644
--- a/README.md
+++ b/README.md
@@ -3,10 +3,20 @@ Bukkit
A Minecraft Server API.
+Coding Conventions
+-----------
+
+* We generally follow the Sun/Oracle coding standards.
+* No tabs; use 4 spaces instead.
+* No trailing whitespaces.
+* No 80 column limit or midstatement newlines.
+
+Follow the above conventions if you want your pull requests accepted.
+
Compilation
-----------
We use maven to handle our dependencies.
* Install [Maven 3](http://maven.apache.org/download.html)
-* Check out this repo and: `mvn clean install`
+* Check out this repo and: `mvn clean install` \ No newline at end of file
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