Class WLocation

java.lang.Object
com.olziedev.playerwarps.api.warp.WLocation

public abstract class WLocation extends Object
Represents a warp location that can provide and manage basic location data for the warp.
  • Constructor Details

    • WLocation

      public WLocation()
  • Method Details

    • getWarpServer

      public abstract String getWarpServer()
      Returns:
      The server where the warp was created.
    • getLocation

      public abstract Location getLocation()
      Returns:
      The Bukkit location of where this warp is located.
    • getWorld

      public abstract String getWorld()
      Returns:
      The name of the world the warp is located in.
    • getBukkitWorld

      public abstract World getBukkitWorld()
      Returns:
      The Bukkit object of the world, this can return null if the world doesn't exist.
    • getWorldType

      public abstract String getWorldType()
      Returns:
      The custom world type name that has been set up in the configuration file.
    • getX

      public abstract double getX()
      Returns:
      The X location of this warp.
    • getY

      public abstract double getY()
      Returns:
      The Y location of this warp.
    • getZ

      public abstract double getZ()
      Returns:
      The Z location of this warp.
    • getYaw

      public abstract float getYaw()
      Returns:
      The yaw location of this warp.
    • getPitch

      public abstract float getPitch()
      Returns:
      The pitch location of this warp.
    • setWarpLocation

      public abstract void setWarpLocation(WLocation warpLocation)
      This will set the new location of this warp.
      Parameters:
      warpLocation - The new warp location that can be created via PlayerWarpsAPI.createWarpLocation(Location).
    • isLocationSafe

      public abstract boolean isLocationSafe()
      Returns:
      If the cached location is safe to teleport to.
    • setLocationSafe

      public abstract void setLocationSafe()
      This will re-set the cached safe location, due to it being very intense it shouldn't be called often.
    • teleportWarp

      public abstract void teleportWarp(Player teleporter, PlayerWarpTeleportEvent.Cause warpCause)
      This will teleport the player to the warp. (using the checks the teleport function uses).
      Parameters:
      teleporter - The player that is teleporting.
      warpCause - The cause of the teleport.
    • teleportLocation

      public abstract void teleportLocation(Player teleporter, WPlayer teleportPlayer, PlayerWarpTeleportEvent event)
      This will teleport the player to the warp.
      Parameters:
      teleporter - The player that is teleporting.
      teleportPlayer - The teleporter object wrapped around PlayerWarpsAPI.getWarpPlayer(UUID)
      event - The event instance that will be called when the teleport has finished, this can be null if you don't want an event called.