/**
   * Checks permissions.
   *
   * @param sender
   * @param perm
   * @return
   */
  public boolean hasPermission(CommandSender sender, String perm) {
    if (sender.isOp()) {
      return true;
    }

    // Invoke the permissions resolver
    if (sender instanceof Player) {
      return perms.hasPermission(((Player) sender).getName(), perm);
    }

    return false;
  }
  /**
   * Called when the plugin is enabled. This is where configuration is loaded, and the plugin is
   * setup.
   */
  public void onEnable() {
    logger.info(getDescription().getName() + " " + getDescription().getVersion() + " enabled.");

    // Make the data folder for the plugin where configuration files
    // and other data files will be stored
    getDataFolder().mkdirs();

    // Prepare permissions
    perms =
        new PermissionsResolverManager(
            getConfiguration(), getServer(), getDescription().getName(), logger);
    perms.load();

    // Register events
    registerEvents();
  }