Interface ActionUtils


public interface ActionUtils
Set of useful action utils in AdditionsPlus.
  • Method Details

    • removeTags

      String removeTags(String actionString)
      Remove all action tags of an action string.
      Parameters:
      actionString - Action string to strip.
      Returns:
      Stripped action string.
    • returnTagArguments

      String[] returnTagArguments(String actionString, AdditionsAction action)
      Get arguments of a certain action tag.
      Parameters:
      actionString - Action string to check.
      action - Action to check.
      Returns:
      String array with the arguments.
    • returnTagArguments

      String[] returnTagArguments(String actionString, AdditionsAction action, String alias)
      Get arguments of a certain action tag.
      Parameters:
      actionString - Action string to check.
      action - Action to check.
      alias - Specific action alias to check.
      Returns:
      String array with the arguments.
    • evaluateRNG

      String evaluateRNG(String[] params)
      Evaluate the RNG (Random Number Generator) in the action string.
      Parameters:
      params - Arguments of the RNG tag.
      Returns:
      Evaluated RNG result.
    • evaluateScript

      String evaluateScript(String actionString)
      Evaluate the script tags in the action string.
      Parameters:
      actionString - Action string to check.
      Returns:
      Evaluated script tags in the action string.
    • evaluateMath

      String evaluateMath(String input)
      Evaluate the mathematical expressions of an action string.
      Parameters:
      input - Action string to check.
      Returns:
      Evaluated math action string.
    • evaluateIfChances

      boolean evaluateIfChances(String actionString)
      Evaluate the if-chances of an action.
      Parameters:
      actionString - Action string to check.
      Returns:
      True when validated, false otherwise.
    • getBaseAction

      AdditionsAction getBaseAction(String actionString)
      Get the base AdditionsAction of this action string.
      Parameters:
      actionString - Action string to check.
      Returns:
      AdditionsAction if found, null otherwise.
    • getPermission

      String getPermission(String actionString)
      Get the permission of an action.
      Parameters:
      actionString - Action string to check.
      Returns:
      Permission of this action string.
    • getRegex

      String getRegex(String actionString)
      Get the specified regex of an action.
      Parameters:
      actionString - Action string to check.
      Returns:
      Regex of this action string.
    • getInWorld

      String getInWorld(String actionString)
      Get the in-world world of an action.
      Parameters:
      actionString - Action string to check.
      Returns:
      In-world world of this action string.
    • getNoPermission

      String getNoPermission(String actionString)
      Get the anti permission of an action.
      Parameters:
      actionString - Action string to check.
      Returns:
      No permission of this action string.
    • getVaultGroup

      String getVaultGroup(String actionString)
      Get the vault group of an action.
      Parameters:
      actionString - Action string to check.
      Returns:
      Vault group of this action string.
    • getNoVaultGroup

      String getNoVaultGroup(String actionString)
      Get the anti vault group of an action.
      Parameters:
      actionString - Action string to check.
      Returns:
      No vault group of this action string.
    • getChance

      double getChance(String actionString)
      Get the chance of an action.
      Parameters:
      actionString - Action string to check.
      Returns:
      Chance of this action string.
    • getLanguage

      String getLanguage(String actionString)
      Get the specified language of an action.
      Parameters:
      actionString - Action string to check.
      Returns:
      Language of this action string.
    • getPrice

      int getPrice(String actionString)
      Get the price of an action.
      Parameters:
      actionString - Action string to check.
      Returns:
      Price of this action string.
    • getDelay

      long getDelay(String actionString)
      Get the delay of an action.
      Parameters:
      actionString - Action string to check.
      Returns:
      Delay of this action string.
    • getWorlds

      List<org.bukkit.World> getWorlds(String action, List<org.bukkit.World> worlds, List<String> worldNames)
      Get a List of World in the action string.
      Parameters:
      action - Action string to check.
      worlds - List of all World.
      worldNames - List of all world names.
      Returns:
      List with all worlds found in this action.
    • getArgumentAsString

      @Nullable String getArgumentAsString(String actionString, AdditionsAction action)
      Get an action argument as string.
      Parameters:
      actionString - Action string to check.
      action - Action to check.
      Returns:
      String when found, null otherwise.
    • getArgumentAsBoolean

      boolean getArgumentAsBoolean(String actionString, AdditionsAction action)
      Get an action argument as boolean.
      Parameters:
      actionString - Action string to check.
      action - Action to check.
      Returns:
      Boolean when found, false otherwise.
    • getArgumentAsInt

      int getArgumentAsInt(String actionString, AdditionsAction action)
      Get an action argument as integer.
      Parameters:
      actionString - Action string to check.
      action - Action to check.
      Returns:
      Integer when found, 0 otherwise.
    • getArgumentAsDouble

      double getArgumentAsDouble(String actionString, AdditionsAction action)
      Get an action argument as double.
      Parameters:
      actionString - Action string to check.
      action - Action to check.
      Returns:
      Double when found, 0 otherwise.