Class TeleportationManager

java.lang.Object
io.github.thebusybiscuit.slimefun4.api.gps.TeleportationManager

public final class TeleportationManager extends Object
The TeleportationManager handles the process of teleportation for a Player who is using a Teleporter.
Author:
TheBusyBiscuit
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getTeleportationTime(int complexity, org.bukkit.Location source, org.bukkit.Location destination)
    This returns the amount of time it will take to teleport from the source Location to the destination Location, given the specified complexity.
    void
    openTeleporterGUI(org.bukkit.entity.Player p, UUID ownerUUID, org.bukkit.block.Block b)
    Opens the GUI of the teleporter and calculates the network complexity of the Player
    void
    openTeleporterGUI(org.bukkit.entity.Player p, UUID ownerUUID, org.bukkit.block.Block b, int complexity)
     
    void
    teleport(UUID uuid, int complexity, org.bukkit.Location source, org.bukkit.Location destination, boolean resistance)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TeleportationManager

      public TeleportationManager()
  • Method Details

    • openTeleporterGUI

      @ParametersAreNonnullByDefault public void openTeleporterGUI(org.bukkit.entity.Player p, UUID ownerUUID, org.bukkit.block.Block b)
      Opens the GUI of the teleporter and calculates the network complexity of the Player
      Parameters:
      p - Player to be teleported
      ownerUUID - UUID of the Player who owns the teleporter device
      b - Block from where the Player is being teleported
    • openTeleporterGUI

      @ParametersAreNonnullByDefault public void openTeleporterGUI(org.bukkit.entity.Player p, UUID ownerUUID, org.bukkit.block.Block b, int complexity)
    • teleport

      @ParametersAreNonnullByDefault public void teleport(UUID uuid, int complexity, org.bukkit.Location source, org.bukkit.Location destination, boolean resistance)
    • getTeleportationTime

      public int getTeleportationTime(int complexity, @Nonnull org.bukkit.Location source, @Nonnull org.bukkit.Location destination)
      This returns the amount of time it will take to teleport from the source Location to the destination Location, given the specified complexity.

      The returned time will be measured in 500ms intervals.

      • A returned time of 100 will mean 50,000ms (50s) of real-life time.
      • A returned time of 10 will mean 5,000ms (5s) of real-life time.
      • A returned time of 2 will mean 1,000ms (1s) of real-life time.
      • and so on...
      Parameters:
      complexity - The complexity of the GPSNetwork
      source - The source Location
      destination - The destination Location
      Returns:
      The amount of time the teleportation will take