Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean hasItem(EntityPlayer player, ItemStack is, int amount) {
- if(is == null)
- return false;
- int found = 0;
- for (ItemStack stack : player.inventory.mainInventory) {
- if(stack != null) {
- if(ItemStack.areItemStacksEqual(stack, is))
- found += stack.stackSize;
- }
- if(found >= amount)
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement