public class Location2D
extends java.lang.Object
Location
class.Constructor and Description |
---|
Location2D(double x,
double y)
Creates a new Location2D from the given points.
|
Location2D(float x,
float y)
Creates a new Location2D from the given points.
|
Location2D(int x,
int y)
Creates a new Location2D from the given points.
|
Location2D(java.lang.String world,
double x,
double y)
Creates a new Location2D from the given points.
|
Location2D(java.lang.String world,
float x,
float y)
Creates a new Location2D from the given points.
|
Location2D(java.lang.String world,
int x,
int y)
Creates a new Location2D from the given points.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object otherObject) |
java.lang.String |
getWorld()
Retrieves the name of the world of this location.
|
float |
getX()
Retrieves the x-coordinate of this location.
|
float |
getY()
Retrieves the y-coordinate of this location.
|
int |
hashCode() |
void |
setWorld(java.lang.String world)
Sets the name of the world of this location.
|
void |
setX(double x)
Sets the x-coordinate of this location.
|
void |
setX(float x)
Sets the x-coordinate of this location.
|
void |
setX(int x)
Sets the x-coordinate of this location.
|
void |
setY(double y)
Sets the y-coordinate of this location.
|
void |
setY(float y)
Sets the y-coordinate of this location.
|
void |
setY(int y)
Sets the y-coordinate of this location.
|
static Location2D |
valueOfXY(org.bukkit.Location location)
Creates a Location2D from the x- and y-coordinates of the given
Bukkit location . |
static Location2D |
valueOfXZ(org.bukkit.Location location)
Creates a Location2D from the x- and z-coordinates of the given
Bukkit location . |
static Location2D |
valueOfYZ(org.bukkit.Location location)
Creates a Location2D from the y- and z-coordinates of the given
Bukkit location . |
public Location2D(java.lang.String world, float x, float y)
world
- the name of the world containing the locationx
- the x-coordinate of the locationy
- the y-coordinate of the locationpublic Location2D(java.lang.String world, double x, double y)
world
- the name of the world containing the locationx
- the x-coordinate of the locationy
- the y-coordinate of the locationpublic Location2D(java.lang.String world, int x, int y)
world
- the name of the world containing the locationx
- the x-coordinate of the locationy
- the y-coordinate of the locationpublic Location2D(float x, float y)
x
- the x-coordinate of the locationy
- the y-coordinate of the locationpublic Location2D(double x, double y)
x
- the x-coordinate of the locationy
- the y-coordinate of the locationpublic Location2D(int x, int y)
x
- the x-coordinate of the locationy
- the y-coordinate of the locationpublic java.lang.String getWorld()
public void setWorld(java.lang.String world)
world
- the name of the world of this location, or null if one was
not providedpublic float getX()
public float getY()
public void setX(float x)
x
- the new x-coordinate of this locationpublic void setX(double x)
x
- the new x-coordinate of this locationpublic void setX(int x)
x
- the new x-coordinate of this locationpublic void setY(float y)
y
- the new y-coordinate of this locationpublic void setY(double y)
y
- the new y-coordinate of this locationpublic void setY(int y)
y
- the new y-coordinate of this locationpublic static Location2D valueOfXY(org.bukkit.Location location)
Bukkit location
.location
- the Bukkit location
to create a
Location2D frompublic static Location2D valueOfXZ(org.bukkit.Location location)
Bukkit location
.location
- the Bukkit location
to create a
Location2D frompublic static Location2D valueOfYZ(org.bukkit.Location location)
Bukkit location
.location
- the Bukkit location
to create a
Location2D frompublic boolean equals(java.lang.Object otherObject)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object