Interface ActionUtils
public interface ActionUtils
Set of useful action utils in AdditionsPlus.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluateIfChances(String actionString) Evaluate the if-chances of an action.evaluateMath(String input) Evaluate the mathematical expressions of an action string.evaluateRNG(String[] params) Evaluate the RNG (Random Number Generator) in the action string.evaluateScript(String actionString) Evaluate the script tags in the action string.booleangetArgumentAsBoolean(String actionString, AdditionsAction action) Get an action argument as boolean.doublegetArgumentAsDouble(String actionString, AdditionsAction action) Get an action argument as double.intgetArgumentAsInt(String actionString, AdditionsAction action) Get an action argument as integer.getArgumentAsString(String actionString, AdditionsAction action) Get an action argument as string.getBaseAction(String actionString) Get the baseAdditionsActionof this action string.doubleGet the chance of an action.longGet the delay of an action.getInWorld(String actionString) Get the in-world world of an action.getLanguage(String actionString) Get the specified language of an action.getNoPermission(String actionString) Get the anti permission of an action.getNoVaultGroup(String actionString) Get the anti vault group of an action.getPermission(String actionString) Get the permission of an action.intGet the price of an action.Get the specified regex of an action.getVaultGroup(String actionString) Get the vault group of an action.List<org.bukkit.World>Get aListofWorldin the action string.removeTags(String actionString) Remove all action tags of an action string.String[]returnTagArguments(String actionString, AdditionsAction action) Get arguments of a certain action tag.String[]returnTagArguments(String actionString, AdditionsAction action, String alias) Get arguments of a certain action tag.
-
Method Details
-
removeTags
Remove all action tags of an action string.- Parameters:
actionString- Action string to strip.- Returns:
- Stripped action string.
-
returnTagArguments
Get arguments of a certain action tag.- Parameters:
actionString- Action string to check.action- Action to check.- Returns:
Stringarray with the arguments.
-
returnTagArguments
Get arguments of a certain action tag.- Parameters:
actionString- Action string to check.action- Action to check.alias- Specific action alias to check.- Returns:
Stringarray with the arguments.
-
evaluateRNG
Evaluate the RNG (Random Number Generator) in the action string.- Parameters:
params- Arguments of the RNG tag.- Returns:
- Evaluated RNG result.
-
evaluateScript
Evaluate the script tags in the action string.- Parameters:
actionString- Action string to check.- Returns:
- Evaluated script tags in the action string.
-
evaluateMath
Evaluate the mathematical expressions of an action string.- Parameters:
input- Action string to check.- Returns:
- Evaluated math action string.
-
evaluateIfChances
Evaluate the if-chances of an action.- Parameters:
actionString- Action string to check.- Returns:
- True when validated, false otherwise.
-
getBaseAction
Get the baseAdditionsActionof this action string.- Parameters:
actionString- Action string to check.- Returns:
AdditionsActionif found, null otherwise.
-
getPermission
Get the permission of an action.- Parameters:
actionString- Action string to check.- Returns:
- Permission of this action string.
-
getRegex
Get the specified regex of an action.- Parameters:
actionString- Action string to check.- Returns:
- Regex of this action string.
-
getInWorld
Get the in-world world of an action.- Parameters:
actionString- Action string to check.- Returns:
- In-world world of this action string.
-
getNoPermission
Get the anti permission of an action.- Parameters:
actionString- Action string to check.- Returns:
- No permission of this action string.
-
getVaultGroup
Get the vault group of an action.- Parameters:
actionString- Action string to check.- Returns:
- Vault group of this action string.
-
getNoVaultGroup
Get the anti vault group of an action.- Parameters:
actionString- Action string to check.- Returns:
- No vault group of this action string.
-
getChance
Get the chance of an action.- Parameters:
actionString- Action string to check.- Returns:
- Chance of this action string.
-
getLanguage
Get the specified language of an action.- Parameters:
actionString- Action string to check.- Returns:
- Language of this action string.
-
getPrice
Get the price of an action.- Parameters:
actionString- Action string to check.- Returns:
- Price of this action string.
-
getDelay
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 aListofWorldin the action string. -
getArgumentAsString
Get an action argument as string.- Parameters:
actionString- Action string to check.action- Action to check.- Returns:
Stringwhen found, null otherwise.
-
getArgumentAsBoolean
Get an action argument as boolean.- Parameters:
actionString- Action string to check.action- Action to check.- Returns:
Booleanwhen found, false otherwise.
-
getArgumentAsInt
Get an action argument as integer.- Parameters:
actionString- Action string to check.action- Action to check.- Returns:
Integerwhen found, 0 otherwise.
-
getArgumentAsDouble
Get an action argument as double.- Parameters:
actionString- Action string to check.action- Action to check.- Returns:
Doublewhen found, 0 otherwise.
-