Package net.gcnt.additionsplus.api
Class CustomAction
java.lang.Object
net.gcnt.additionsplus.api.CustomAction
Class that contains all information about custom actions.
- 
Constructor Summary
ConstructorsConstructorDescriptionCustomAction(String identifier, List<String> aliases, ActionType type, boolean playersOnly, Consumer<QueuedAction> runnable) - 
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsTag(String actionString)Check if a string contains this custom action.Get a list of aliases that can be used as a replacement for the default identifier.Get the java consumer that is being executed when the action is being requested.Get the identifier of the custom action.getType()Get the action type of this custom action.booleanWhether this action can only be executed as a player or also from the console.voidsetAliases(List<String> aliases)Set the list of aliases for a custom action.voidsetPlayersOnly(boolean playersOnly)Set whether the sender has to be a player.voidsetType(ActionType type)Set the action type of this custom action. 
- 
Constructor Details
- 
CustomAction
public CustomAction(@Nonnull String identifier, @Nonnull List<String> aliases, @Nonnull ActionType type, boolean playersOnly, @Nonnull Consumer<QueuedAction> runnable) 
 - 
 - 
Method Details
- 
getIdentifier
Get the identifier of the custom action. Action is as follows: [identifier]- Returns:
 Stringaction identifier.
 - 
getAliases
Get a list of aliases that can be used as a replacement for the default identifier.- Returns:
 - List of 
Stringwith all aliases. 
 - 
setAliases
Set the list of aliases for a custom action.- Parameters:
 aliases- String list with all possible aliases.
 - 
getType
Get the action type of this custom action.- Returns:
 ActionTypeof the custom action.
 - 
setType
Set the action type of this custom action.- Parameters:
 type-CustomActiontype of action.
 - 
isPlayersOnly
public boolean isPlayersOnly()Whether this action can only be executed as a player or also from the console.- Returns:
 Booleanwhether 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-Booleanwhether the sender should be a player.
 - 
containsTag
Check if a string contains this custom action.- Parameters:
 actionString- Action string to check.- Returns:
 Booleanwhether the actionString contains this custom action.
 - 
getConsumer
Get the java consumer that is being executed when the action is being requested.- Returns:
 ConsumerwithQueuedActionto be executed.
 
 -