Class DestinationFactory


  • public class DestinationFactory
    extends java.lang.Object
    A factory class that will create destinations from specific strings.
    • Constructor Detail

      • DestinationFactory

        public DestinationFactory​(MultiverseCore plugin)
    • Method Detail

      • getPlayerAwareDestination

        @NotNull
        public @NotNull MVDestination getPlayerAwareDestination​(@NotNull
                                                                @NotNull org.bukkit.entity.Player teleportee,
                                                                @NotNull
                                                                @NotNull java.lang.String destinationName)
        Parse a destination that has relation to sender, such as a cannon or player destination.
        Parameters:
        teleportee - The player that is going to be teleported.
        destinationName - The destination to parse.
        Returns:
        A non-null MVDestination
      • getDestination

        public MVDestination getDestination​(java.lang.String destination)
        Gets a new destination from a string. Returns a new InvalidDestination if the string could not be parsed.
        Parameters:
        destination - The destination in string format.
        Returns:
        A non-null MVDestination
      • registerDestinationType

        public boolean registerDestinationType​(java.lang.Class<? extends MVDestination> c,
                                               java.lang.String identifier)
        Registers a MVDestination.
        Parameters:
        c - The Class of the MVDestination to register.
        identifier - The String-identifier.
        Returns:
        True if the class was successfully registered.
      • getRegisteredIdentifiers

        public java.util.Collection<java.lang.String> getRegisteredIdentifiers()
        Gets all the MVDestination identifiers registered.
        Returns:
        A collection of destination identifiers.