Class WLocation
java.lang.Object
com.olziedev.playerwarps.api.warp.WLocation
Represents a warp location that can provide and manage basic location data for the warp.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract World
abstract Location
abstract float
getPitch()
abstract String
abstract String
getWorld()
abstract String
abstract double
getX()
abstract double
getY()
abstract float
getYaw()
abstract double
getZ()
abstract boolean
abstract void
This will re-set the cached safe location, due to it being very intense it shouldn't be called often.abstract void
setWarpLocation
(WLocation warpLocation) This will set the new location of this warp.abstract void
teleportLocation
(Player teleporter, WPlayer teleportPlayer, PlayerWarpTeleportEvent event) This will teleport the player to the warp.abstract void
teleportWarp
(Player teleporter, PlayerWarpTeleportEvent.Cause warpCause) This will teleport the player to the warp.
-
Constructor Details
-
WLocation
public WLocation()
-
-
Method Details
-
getWarpServer
- Returns:
- The server where the warp was created.
-
getLocation
- Returns:
- The Bukkit location of where this warp is located.
-
getWorld
- Returns:
- The name of the world the warp is located in.
-
getBukkitWorld
- Returns:
- The Bukkit object of the world, this can return null if the world doesn't exist.
-
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
This will set the new location of this warp.- Parameters:
warpLocation
- The new warp location that can be created viaPlayerWarpsAPI.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
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 aroundPlayerWarpsAPI.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.
-