From 817bdc198454700be85648e433d4f16378e71a4a Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 24 Jan 2011 07:32:53 +0800 Subject: [PATCH 1/4] Implemented Inventory.contains with a minimum amount of item required. As per feature request #187 By: Limb --- .../java/org/bukkit/inventory/Inventory.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/inventory/Inventory.java b/paper-api/src/main/java/org/bukkit/inventory/Inventory.java index e0b525626..01c9160c0 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/Inventory.java +++ b/paper-api/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 From 3e09bd4b94f91b820f053bce021ae9edbcef593d Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 3 Feb 2011 13:13:44 -0800 Subject: [PATCH 2/4] Added brief coding conventions - these may not be complete. By: Warren --- paper-api/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/paper-api/README.md b/paper-api/README.md index ceac25401..11c142df1 100644 --- a/paper-api/README.md +++ b/paper-api/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 From ba9a02c3c7a48c31eadcd6286b7cee4bf691431e Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 3 Feb 2011 13:14:12 -0800 Subject: [PATCH 3/4] I suck at markdown. By: Warren --- paper-api/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paper-api/README.md b/paper-api/README.md index 11c142df1..9a3d5042e 100644 --- a/paper-api/README.md +++ b/paper-api/README.md @@ -7,8 +7,11 @@ 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. From c89f2806b0607c67f45b04d863d7330cb4030d5c Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 3 Feb 2011 13:15:00 -0800 Subject: [PATCH 4/4] I *really* suck at markdown. By: Warren --- paper-api/README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/paper-api/README.md b/paper-api/README.md index 9a3d5042e..a1551a4fd 100644 --- a/paper-api/README.md +++ b/paper-api/README.md @@ -6,13 +6,10 @@ 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. +* 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.