Bukkit functions > custom functions

This commit is contained in:
Acrobot 2012-12-22 21:04:15 +01:00
parent 7902e94591
commit 841a67a54b
2 changed files with 2 additions and 10 deletions

View File

@ -67,7 +67,7 @@ public class InventoryUtil {
*/
public static boolean hasItems(ItemStack[] items, Inventory inventory) {
for (ItemStack item : items) {
if (InventoryUtil.getAmount(item, inventory) < item.getAmount()) {
if (!inventory.containsAtLeast(item, item.getAmount())) {
return false;
}
}

View File

@ -41,15 +41,7 @@ public class MaterialUtil {
* @return Are they equal?
*/
public static boolean equals(ItemStack one, ItemStack two) {
if (one.getType() != two.getType()) {
return false;
}
if (one.getDurability() != two.getDurability()) {
return false;
}
return one.getEnchantments().equals(two.getEnchantments());
return one.isSimilar(two);
}
/**