Class ActionLoader
java.lang.Object
io.github.lucfr1746.llibrary.action.ActionLoader
Loads and manages different types of actions in the plugin.
Provides a way to register, retrieve, and process actions based on string inputs.
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes the ActionLoader and registers all available actions. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves an Action instance based on an input string.getActions
(List<String> inputs) Retrieves a list of Action instances based on a list of input strings.void
registerAction
(String identifier, Function<String, Action> factory) Registers an action with a specific identifier.
-
Constructor Details
-
ActionLoader
public ActionLoader()Initializes the ActionLoader and registers all available actions.
-
-
Method Details
-
registerAction
Registers an action with a specific identifier.- Parameters:
identifier
- The string identifier for the action.factory
- The function that creates the action instance.
-
getAction
Retrieves an Action instance based on an input string.- Parameters:
input
- The input string defining the action.- Returns:
- The corresponding Action instance or null if not found.
-
getActions
Retrieves a list of Action instances based on a list of input strings.- Parameters:
inputs
- A list of action input strings.- Returns:
- A list of corresponding Action instances.
-