Package me.bimmr.bimmcore.utils
Class InventoryUtil
- java.lang.Object
-
- me.bimmr.bimmcore.utils.InventoryUtil
-
public class InventoryUtil extends java.lang.Object
Collection of methods relating to Inventory management
-
-
Constructor Summary
Constructors Constructor Description InventoryUtil()
-
Method Summary
Modifier and Type Method Description static boolean
containsItem(org.bukkit.inventory.Inventory inventory, org.bukkit.inventory.ItemStack itemStack, int quantity)
Checks if the inventory contains the number of items givenstatic boolean
removeItem(org.bukkit.inventory.Inventory inventory, org.bukkit.inventory.ItemStack itemStack, int quantity)
Remove items in the inventory up to the amount given.
-
-
-
Method Detail
-
containsItem
public static boolean containsItem(org.bukkit.inventory.Inventory inventory, org.bukkit.inventory.ItemStack itemStack, int quantity)
Checks if the inventory contains the number of items given- Parameters:
inventory
- the inventoryitemStack
- the itemstackquantity
- the amount- Returns:
- if the inventory contains the quantity of itemstack
-
removeItem
public static boolean removeItem(org.bukkit.inventory.Inventory inventory, org.bukkit.inventory.ItemStack itemStack, int quantity)
Remove items in the inventory up to the amount given. Starts at the bottom of the inventory and works it's way upWill return a true or false depending on if all the items were removed
- Parameters:
inventory
- the inventoryitemStack
- the itemstackquantity
- the quantity- Returns:
- if able to remove all the items
-
-