mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-01-24 07:41:20 +01:00
Bukkit functions > custom functions
This commit is contained in:
parent
7902e94591
commit
841a67a54b
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user