A feature-rich Minecraft plugin which enhances gaming experience
git clone git://soophie.de/poppy
blob: 65111b5884613576e2289f718e3c30831cc5de43 (639 bytes)[doc][blame][raw]
1
package de.typable.minecrafthub.util;3
import org.bukkit.Material;4
import org.bukkit.inventory.Inventory;5
import org.bukkit.inventory.ItemStack;7
public class Util8
{9
public static boolean isEmpty(ItemStack item)10
{11
return item == null || item.getType() == Material.AIR;12
}14
public static boolean isInventoryFull(Inventory inventory, ItemStack result)15
{16
for(ItemStack item : inventory.getContents())17
{18
if(Util.isEmpty(item))19
{20
return false;21
}23
if(result.isSimilar(item))24
{25
if(result.getAmount() + item.getAmount() <= item.getMaxStackSize())26
{27
return false;28
}29
}30
}32
return true;33
}34
}