public static boolean hasTool(Player player, ItemStack tool)
    {
        if(tool == null) return true;
        for(ItemStack i : player.getInventory().getContents())
        {
            if(tool.isSimilar(i))
            {
                return true;
            }
        }
        for(ItemStack i : player.getInventory().getArmorContents())
        {
            if(tool.isSimilar(i))
            {
                return true;
            }
        }
        return false;
    }