Class SimpleTeleportationManager

    • Method Summary

      Modifier and Type Method Description
      CompletableFuture<Boolean> allowedTeleport​(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.Location location)
      Check whether or not the player is allowed to teleport to the specified location
      CompletableFuture<Boolean> canTeleport​(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.Location location)
      Check whether or not the player can safely teleport to the specified location
      @Nullable org.bukkit.Location endDestination​(@NotNull org.bukkit.entity.Entity entity)
      Handle end portal teleportation
      @NotNull CompletableFuture<org.bukkit.Location> findSafe​(@NotNull org.bukkit.Location location)
      Find a safe teleportation location near the specified location
      @Nullable org.bukkit.Location netherDestination​(@NotNull org.bukkit.entity.Entity entity, @NotNull org.bukkit.Location location)
      Handle nether portal teleportation
      void teleportPlayer​(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.Location location)
      Teleport the player to a given location
    • Constructor Detail

      • SimpleTeleportationManager

        @Inject
        public SimpleTeleportationManager​(HyperWorld hyperWorld,
                                          WorldManager worldManager,
                                          NMS nms)
    • Method Detail

      • allowedTeleport

        public CompletableFuture<Boolean> allowedTeleport​(@NotNull
                                                          @NotNull org.bukkit.entity.Player player,
                                                          @NotNull
                                                          @NotNull org.bukkit.Location location)
        Description copied from interface: TeleportationManager
        Check whether or not the player is allowed to teleport to the specified location
        Specified by:
        allowedTeleport in interface TeleportationManager
        Parameters:
        player - Player that is about to teleport
        location - Location the player is teleporting to
        Returns:
        True if the player is allowed to teleport to the location
      • canTeleport

        public CompletableFuture<Boolean> canTeleport​(@NotNull
                                                      @NotNull org.bukkit.entity.Player player,
                                                      @NotNull
                                                      @NotNull org.bukkit.Location location)
        Description copied from interface: TeleportationManager
        Check whether or not the player can safely teleport to the specified location
        Specified by:
        canTeleport in interface TeleportationManager
        Parameters:
        player - Player that is about to teleport
        location - Location the player is teleporting to
        Returns:
        True if the player is able to teleport to the location
      • findSafe

        @NotNull
        public @NotNull CompletableFuture<org.bukkit.Location> findSafe​(@NotNull
                                                                        @NotNull org.bukkit.Location location)
        Description copied from interface: TeleportationManager
        Find a safe teleportation location near the specified location
        Specified by:
        findSafe in interface TeleportationManager
        Parameters:
        location - Search origin
        Returns:
        Safe location
      • teleportPlayer

        public void teleportPlayer​(@NotNull
                                   @NotNull org.bukkit.entity.Player player,
                                   @NotNull
                                   @NotNull org.bukkit.Location location)
        Description copied from interface: TeleportationManager
        Teleport the player to a given location
        Specified by:
        teleportPlayer in interface TeleportationManager
        Parameters:
        player - Player to teleport
        location - Location to teleport the player to
      • netherDestination

        @Nullable
        public @Nullable org.bukkit.Location netherDestination​(@NotNull
                                                               @NotNull org.bukkit.entity.Entity entity,
                                                               @NotNull
                                                               @NotNull org.bukkit.Location location)
        Description copied from interface: TeleportationManager
        Handle nether portal teleportation
        Specified by:
        netherDestination in interface TeleportationManager
        Parameters:
        entity - Entity to teleport
        location - Portal location
      • endDestination

        @Nullable
        public @Nullable org.bukkit.Location endDestination​(@NotNull
                                                            @NotNull org.bukkit.entity.Entity entity)
        Description copied from interface: TeleportationManager
        Handle end portal teleportation
        Specified by:
        endDestination in interface TeleportationManager
        Parameters:
        entity - Entity to teleport