Class ActionHandler<T extends ActionHandlerType<T,H>,H extends ActionHandler<T,H>>
java.lang.Object
org.mvplugins.multiverse.portals.action.ActionHandler<T,H>
- Type Parameters:
T- The type of the action handlerH- The specific action handler class
@AvailableSince("5.2")
public abstract class ActionHandler<T extends ActionHandlerType<T,H>,H extends ActionHandler<T,H>>
extends Object
Represents an action handler that performs a specific action when an entity uses a portal.
- Since:
- 5.2
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedActionHandler(T handlerType) Create a new action handler. -
Method Summary
Modifier and TypeMethodDescriptionabstract @NotNull org.mvplugins.multiverse.core.locale.message.MessageactionDescription(org.bukkit.entity.Entity entity) Get a description of the action for display purposes.Get the type of this action handler.abstract @NotNull org.mvplugins.multiverse.core.utils.result.Attempt<Void, ActionFailureReason> Run the action for the given portal and entity.abstract @NotNull StringSerialise the action handler back into a string.toString()
-
Constructor Details
-
ActionHandler
Create a new action handler.- Parameters:
handlerType- The type of this action handler- Since:
- 5.2
-
-
Method Details
-
getHandlerType
Get the type of this action handler.- Returns:
- The action handler type
- Since:
- 5.2
-
runAction
@AvailableSince("5.2") @NotNull public abstract @NotNull org.mvplugins.multiverse.core.utils.result.Attempt<Void,ActionFailureReason> runAction(@NotNull @NotNull MVPortal portal, @NotNull @NotNull org.bukkit.entity.Entity entity) Run the action for the given portal and entity.- Parameters:
portal- The portal being usedentity- The entity using the portal- Returns:
- An attempt indicating success or failure of the action
- Since:
- 5.2
-
actionDescription
@AvailableSince("5.2") @NotNull public abstract @NotNull org.mvplugins.multiverse.core.locale.message.Message actionDescription(org.bukkit.entity.Entity entity) Get a description of the action for display purposes.- Parameters:
entity- The entity to describe the action for- Returns:
- The action description message
- Since:
- 5.2
-
serialise
Serialise the action handler back into a string.- Returns:
- The serialised action handler
- Since:
- 5.2
-
toString
-