Class DestinationsProvider
java.lang.Object
org.mvplugins.multiverse.core.destination.DestinationsProvider
Provides destinations for teleportation.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription@Nullable Destination<?, ?, ?> getDestinationById(@Nullable String identifier) Gets a destination by its identifier.@NotNull Collection<Destination<?, ?, ?>> Gets all registered destinations.@NotNull Attempt<DestinationInstance<?, ?>, FailureReason> parseDestination(@NotNull String destinationString) Converts a destination string to a destination object.@NotNull Attempt<DestinationInstance<?, ?>, FailureReason> parseDestination(@NotNull org.bukkit.command.CommandSender sender, @NotNull String destinationString) Converts a destination string to a destination object with sender context.voidregisterDestination(@NotNull Destination<?, ?, ?> destination) Adds a destination to the provider.@NotNull Collection<DestinationSuggestionPacket> suggestDestinations(@NotNull org.bukkit.command.CommandSender sender, @Nullable String destinationParams) Gets suggestions for possible parsable destinations.@NotNull Collection<String> suggestDestinationStrings(@NotNull org.bukkit.command.CommandSender sender, @Nullable String destinationParams) Gets suggestions for possible parsable destinations.
-
Method Details
-
registerDestination
Adds a destination to the provider.- Parameters:
destination- The destination.
-
parseDestination
@NotNull public @NotNull Attempt<DestinationInstance<?,?>, parseDestinationFailureReason> (@NotNull @NotNull String destinationString) Converts a destination string to a destination object.- Parameters:
destinationString- The destination string.- Returns:
- The destination object, or null if invalid format.
-
parseDestination
@AvailableSince("5.1") @NotNull public @NotNull Attempt<DestinationInstance<?,?>, parseDestinationFailureReason> (@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String destinationString) Converts a destination string to a destination object with sender context.- Parameters:
sender- The target sender context.destinationString- The destination string.- Returns:
- The destination object, or null if invalid format.
- Since:
- 5.1
-
getDestinationById
@Nullable public @Nullable Destination<?,?, getDestinationById?> (@Nullable @Nullable String identifier) Gets a destination by its identifier.- Parameters:
identifier- The identifier.- Returns:
- The destination, or null if not found.
-
getDestinations
Gets all registered destinations.- Returns:
- A collection of destinations.
-
suggestDestinations
@NotNull public @NotNull Collection<DestinationSuggestionPacket> suggestDestinations(@NotNull @NotNull org.bukkit.command.CommandSender sender, @Nullable @Nullable String destinationParams) Gets suggestions for possible parsable destinations.- Parameters:
sender- The target sender context.destinationParams- The current user input.- Returns:
- A collection of destination suggestions.
-
suggestDestinationStrings
@AvailableSince("5.1") @NotNull public @NotNull Collection<String> suggestDestinationStrings(@NotNull @NotNull org.bukkit.command.CommandSender sender, @Nullable @Nullable String destinationParams) Gets suggestions for possible parsable destinations.- Parameters:
sender- The target sender context.destinationParams- The current user input.- Returns:
- A collection of destination suggestions in parsable string format.
- Since:
- 5.1
-