Class DestinationFactory
- java.lang.Object
-
- com.onarandombox.MultiverseCore.destination.DestinationFactory
-
public class DestinationFactory extends java.lang.ObjectA factory class that will create destinations from specific strings.
-
-
Constructor Summary
Constructors Constructor Description DestinationFactory(MultiverseCore plugin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MVDestinationgetDestination(java.lang.String destination)Gets a new destination from a string.@NotNull MVDestinationgetPlayerAwareDestination(@NotNull org.bukkit.entity.Player teleportee, @NotNull java.lang.String destinationName)Parse a destination that has relation to sender, such as a cannon or player destination.java.util.Collection<java.lang.String>getRegisteredIdentifiers()Gets all theMVDestinationidentifiers registered.booleanregisterDestinationType(java.lang.Class<? extends MVDestination> c, java.lang.String identifier)Registers aMVDestination.
-
-
-
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 aMVDestination.- Parameters:
c- TheClassof theMVDestinationto register.identifier- TheString-identifier.- Returns:
- True if the class was successfully registered.
-
getRegisteredIdentifiers
public java.util.Collection<java.lang.String> getRegisteredIdentifiers()
Gets all theMVDestinationidentifiers registered.- Returns:
- A collection of destination identifiers.
-
-