Class CustomAction

java.lang.Object
net.gcnt.additionsplus.api.CustomAction

public class CustomAction extends Object
Class that contains all information about custom actions.
  • Constructor Details

  • Method Details

    • getIdentifier

      public String getIdentifier()
      Get the identifier of the custom action. Action is as follows: [identifier]
      Returns:
      String action identifier.
    • getAliases

      public List<String> getAliases()
      Get a list of aliases that can be used as a replacement for the default identifier.
      Returns:
      List of String with all aliases.
    • setAliases

      public void setAliases(List<String> aliases)
      Set the list of aliases for a custom action.
      Parameters:
      aliases - String list with all possible aliases.
    • getType

      public ActionType getType()
      Get the action type of this custom action.
      Returns:
      ActionType of the custom action.
    • setType

      public void setType(ActionType type)
      Set the action type of this custom action.
      Parameters:
      type - CustomAction type of action.
    • isPlayersOnly

      public boolean isPlayersOnly()
      Whether this action can only be executed as a player or also from the console.
      Returns:
      Boolean whether or the sender has to be a player.
    • setPlayersOnly

      public void setPlayersOnly(boolean playersOnly)
      Set whether the sender has to be a player.
      Parameters:
      playersOnly - Boolean whether the sender should be a player.
    • containsTag

      public boolean containsTag(String actionString)
      Check if a string contains this custom action.
      Parameters:
      actionString - Action string to check.
      Returns:
      Boolean whether the actionString contains this custom action.
    • getConsumer

      public Consumer<QueuedAction> getConsumer()
      Get the java consumer that is being executed when the action is being requested.
      Returns:
      Consumer with QueuedAction to be executed.