From 3276998ebef0e9764b17a5e6efa7e7e944b4130c Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 30 Oct 2012 04:52:43 -0400 Subject: [PATCH] Add clear inventory API to PlayerInventory with a successful count return. Adds BUKKIT-2745 By: EvilSeph --- .../java/org/bukkit/inventory/PlayerInventory.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java b/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java index 572210910c..6931ccf99f 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java @@ -102,5 +102,16 @@ public interface PlayerInventory extends Inventory { */ public int getHeldItemSlot(); + /** + * Clears all matching items from the inventory. Setting either value to -1 will skip it's check, + * while setting both to -1 will clear all items in your inventory unconditionally. + * + * @param id the id of the item you want to clear from the inventory + * @param data the data of the item you want to clear from the inventory + * + * @return The number of items cleared + */ + public int clear(int id, int data); + public HumanEntity getHolder(); }