From bf568ddd63a06b55ee334324a0a97568cd3268e9 Mon Sep 17 00:00:00 2001 From: sky Date: Fri, 10 Jan 2020 20:23:26 +0800 Subject: [PATCH] Fix ItemStack --- .../scala/io/izzel/taboolib/cronus/bukkit/ItemStack.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/scala/io/izzel/taboolib/cronus/bukkit/ItemStack.java b/src/main/scala/io/izzel/taboolib/cronus/bukkit/ItemStack.java index 92aade4..8d902d0 100644 --- a/src/main/scala/io/izzel/taboolib/cronus/bukkit/ItemStack.java +++ b/src/main/scala/io/izzel/taboolib/cronus/bukkit/ItemStack.java @@ -47,12 +47,16 @@ public class 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) { - return Items.hasItem(player.getInventory(), this::isItem, amount); + return Items.hasItem(player.getInventory(), this::isSimilar, amount); } public boolean takeItem(Player player) { - return Items.takeItem(player.getInventory(), this::isItem, amount); + return Items.takeItem(player.getInventory(), this::isSimilar, amount); } public String getType() {