Example #1
0
  /**
   * Checks if the command sender has a permission.
   *
   * @param node The permission node
   * @return true is the sender has a permission, false if not.
   */
  public static boolean playerHasPermission(Player player, String node) {
    boolean usePermissions = Configuration.getBoolean("configuration.use-permissions");

    if (!usePermissions) {
      if (player.isOp()) return true;
      else return false;
    }
    if (player.hasPermission("ecm." + node)) return true;
    return false;
  }
Example #2
0
  /**
   * Checks if the command sender has a permission.
   *
   * @param node The permissions node.
   * @return true is the sender has a permission, false if not.
   */
  public static boolean senderHasPermission(String node) {
    CommandSender sender = CommandManager.getSender();
    boolean usePermissions = Configuration.getBoolean("configuration.use-permissions");

    // Console always has the permissions
    Player player;
    if (isPlayer()) player = (Player) sender;
    else return true;

    // If permissions are not used, check for op
    if (!usePermissions) {
      if (player.isOp()) return true;
      else return false;
    }

    if (player.hasPermission("ecm." + node)) return true;
    return false;
  }
Example #3
0
 public static boolean debugEnabled() {
   if (Configuration.getBoolean("configuration.debug-mod")) return true;
   else return false;
 }