Reworked and fixed isDust and isWand check #2

This commit is contained in:
Mohamad82Bz 2021-05-23 22:04:41 +04:30
parent 3e5efd4090
commit cee6c7c999

View File

@ -319,11 +319,12 @@ public class WandManager implements Listener {
public static boolean isWand(Player p) public static boolean isWand(Player p)
{ {
ItemStack is = p.getInventory().getItemInMainHand(); ItemStack is = p.getInventory().getItemInMainHand();
return is != null && is.equals(wand); return is != null && isWand(is);
} }
public static boolean isWand(ItemStack is) public static boolean isWand(ItemStack is)
{ {
ItemStack wand = createWand();
if (is.getItemMeta() == null) return false; if (is.getItemMeta() == null) return false;
return is.getType().equals(wand.getType()) && return is.getType().equals(wand.getType()) &&
is.getItemMeta().getDisplayName().equals(wand.getItemMeta().getDisplayName()) && is.getItemMeta().getDisplayName().equals(wand.getItemMeta().getDisplayName()) &&