Class ActionHandlerProvider
java.lang.Object
org.mvplugins.multiverse.portals.action.ActionHandlerProvider
Provides various actions that can be performed when a portal is used. This extends to more than just teleporting.
Built-in action handler types include "server", "command", and "multiverse-destination", which can be used to perform actions such as sending players to different servers, executing commands, or teleporting to predefined destinations, respectively.
You can also create custom action handler types by implementing the
Built-in action handler types include "server", "command", and "multiverse-destination", which can be used to perform actions such as sending players to different servers, executing commands, or teleporting to predefined destinations, respectively.
You can also create custom action handler types by implementing the
ActionHandlerType class and
registering them with this provider.- Since:
- 5.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection<String> Get all registered handler types names.@NotNull org.mvplugins.multiverse.core.utils.result.Attempt<? extends ActionHandlerType<?, ?>, ActionFailureReason> getHandlerType(@NotNull String name) Get the handler type by name.@NotNull org.mvplugins.multiverse.core.utils.result.Attempt<? extends ActionHandler<?, ?>, ActionFailureReason> parseHandler(@NotNull String actionType, @NotNull String action) Parse the action handler from the given type and action string, using the console as the command sender.@NotNull org.mvplugins.multiverse.core.utils.result.Attempt<? extends ActionHandler<?, ?>, ActionFailureReason> parseHandler(@NotNull org.bukkit.command.CommandSender sender, @NotNull String actionType, @NotNull String action) Parse the action handler from the given type and action string.voidregisterHandlerType(@NotNull ActionHandlerType<?, ?> handlerType) Register a new action handler type.
-
Constructor Details
-
ActionHandlerProvider
public ActionHandlerProvider()
-
-
Method Details
-
registerHandlerType
@AvailableSince("5.2") public void registerHandlerType(@NotNull @NotNull ActionHandlerType<?, ?> handlerType) Register a new action handler type.- Parameters:
handlerType- The action handler type to register- Since:
- 5.2
-
getAllHandlerTypeNames
Get all registered handler types names.- Returns:
- Names of all registered handler types
- Since:
- 5.2
-
getHandlerType
@AvailableSince("5.2") @NotNull public @NotNull org.mvplugins.multiverse.core.utils.result.Attempt<? extends ActionHandlerType<?,?>, getHandlerTypeActionFailureReason> (@NotNull @NotNull String name) Get the handler type by name.- Parameters:
name- The name of the handler type- Returns:
- The handler type, or a failure reason if not found
- Since:
- 5.2
-
parseHandler
@AvailableSince("5.2") @NotNull public @NotNull org.mvplugins.multiverse.core.utils.result.Attempt<? extends ActionHandler<?,?>, parseHandlerActionFailureReason> (@NotNull @NotNull String actionType, @NotNull @NotNull String action) Parse the action handler from the given type and action string, using the console as the command sender.- Parameters:
actionType- The type of the action handleraction- The action string- Returns:
- The parsed action handler, or a failure reason if type is invalid or action string is of invalid format.
- Since:
- 5.2
-
parseHandler
@AvailableSince("5.2") @NotNull public @NotNull org.mvplugins.multiverse.core.utils.result.Attempt<? extends ActionHandler<?,?>, parseHandlerActionFailureReason> (@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String actionType, @NotNull @NotNull String action) Parse the action handler from the given type and action string.- Parameters:
sender- The command sender parsing the actionactionType- The type of the action handleraction- The action string- Returns:
- The parsed action handler, or a failure reason if type is invalid or action string is of invalid format.
- Since:
- 5.2
-