Fix ItemStack

This commit is contained in:
sky 2020-01-10 20:23:26 +08:00
parent ea9a782975
commit bf568ddd63

View File

@ -47,12 +47,16 @@ public class ItemStack {
return isType(itemStack) && isName(itemStack) && isLore(itemStack) && isDamage(itemStack) && isAmount(itemStack); return isType(itemStack) && isName(itemStack) && isLore(itemStack) && isDamage(itemStack) && isAmount(itemStack);
} }
public boolean isSimilar(org.bukkit.inventory.ItemStack itemStack) {
return isType(itemStack) && isName(itemStack) && isLore(itemStack) && isDamage(itemStack);
}
public boolean hasItem(Player player) { public boolean hasItem(Player player) {
return Items.hasItem(player.getInventory(), this::isItem, amount); return Items.hasItem(player.getInventory(), this::isSimilar, amount);
} }
public boolean takeItem(Player player) { public boolean takeItem(Player player) {
return Items.takeItem(player.getInventory(), this::isItem, amount); return Items.takeItem(player.getInventory(), this::isSimilar, amount);
} }
public String getType() { public String getType() {