Interface Destination<D extends Destination<D,T,F>,T extends DestinationInstance<T,D>,F extends FailureReason>
- Type Parameters:
D
- The type of the destinationT
- The type of the destination instance
- All Known Implementing Classes:
AnchorDestination
,BedDestination
,CannonDestination
,ExactDestination
,PlayerDestination
,WorldDestination
@Contract
public interface Destination<D extends Destination<D,T,F>,T extends DestinationInstance<T,D>,F extends FailureReason>
A destination is a location that can be teleported to.
-
Method Summary
Modifier and TypeMethodDescriptiongetDestinationInstance
(@NotNull String destinationParams) Returns the destination instance for the given destination parameters.@NotNull String
Returns the identifier or prefix that is required for this destination.@NotNull Collection
<DestinationSuggestionPacket> suggestDestinations
(@NotNull org.bukkit.command.CommandSender commandSender, @Nullable String destinationParams) Returns a list of possible destinations for the given destination parameters.
-
Method Details
-
getIdentifier
Returns the identifier or prefix that is required for this destination.Portals have a prefix of "p" for example and OpenWarp (third party plugin) uses "ow". This is derived from a hash and cannot have duplicate values. Read that as your plugin cannot use 'p' because it's already used. Please check the wiki when adding a custom destination!
- Returns:
- The identifier or prefix that is required for this destination.
-
getDestinationInstance
Returns the destination instance for the given destination parameters.- Parameters:
destinationParams
- The destination parameters. ex: p:MyPortal:nw- Returns:
- The destination instance, or null if the destination parameters are invalid.
-
suggestDestinations
@NotNull @NotNull Collection<DestinationSuggestionPacket> suggestDestinations(@NotNull @NotNull org.bukkit.command.CommandSender commandSender, @Nullable @Nullable String destinationParams) Returns a list of possible destinations for the given destination parameters. This packet's destination should be this instance and not other destinations.- Parameters:
commandSender
- The command senderdestinationParams
- The destination parameters. ex: p:MyPortal:nw- Returns:
- A list of possible destinations
-