Class ActionHandlerProvider

java.lang.Object
org.mvplugins.multiverse.portals.action.ActionHandlerProvider

@AvailableSince("5.2") @Service public final class ActionHandlerProvider extends Object
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 ActionHandlerType class and registering them with this provider.
Since:
5.2
  • 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

      @AvailableSince("5.2") @NotNull public @NotNull Collection<String> 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<?,?>,ActionFailureReason> getHandlerType(@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<?,?>,ActionFailureReason> parseHandler(@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 handler
      action - 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<?,?>,ActionFailureReason> parseHandler(@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 action
      actionType - The type of the action handler
      action - 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