public class ChunkLocation
extends java.lang.Object
Constructor and Description |
---|
ChunkLocation(org.bukkit.Chunk chunk)
Create a ChunkLocation from a Bukkit chunk.
|
ChunkLocation(ChunkLocation location)
Copy a ChunkLocation.
|
ChunkLocation(org.bukkit.ChunkSnapshot snapshot)
Create a ChunkLocation from a ChunkSnapshot.
|
ChunkLocation(org.bukkit.Location location)
Construct a ChunkLocation from a Location.
|
ChunkLocation(org.bukkit.World world,
int x,
int z)
Create a ChunkLocation from chunk coordinates.
|
Modifier and Type | Method and Description |
---|---|
ChunkLocation |
add(int x,
int z)
Add coordinates from current coordinates.
|
boolean |
equals(java.lang.Object obj) |
boolean |
exists()
Check if this chunk exists.
|
org.bukkit.Chunk |
getChunk()
Get the chunk this location represents.
|
org.bukkit.World |
getWorld()
Get the world.
|
int |
getX()
Get the x coordinate.
|
int |
getZ()
Get the z coordinate.
|
int |
hashCode() |
boolean |
isLoaded()
Check if the chunk that this location represents is loaded.
|
void |
load()
Load the chunk that this location represents.
|
void |
setWorld(org.bukkit.World world)
Set the world.
|
ChunkLocation |
setX(int x)
Set the x coordinate.
|
ChunkLocation |
setZ(int z)
Set the z coordinate.
|
ChunkLocation |
subtract(int x,
int z)
Subtract coordinates from current coordinates.
|
java.lang.String |
toString() |
public ChunkLocation(org.bukkit.Location location)
location
- Cannot be null.public ChunkLocation(ChunkLocation location)
location
- Cannot be null.public ChunkLocation(org.bukkit.World world, int x, int z)
world
- Cannot be null.x
- Chunk coordinate x value.z
- Chunk coordinate z value.public ChunkLocation(org.bukkit.Chunk chunk)
chunk
- Cannot be null.public ChunkLocation(org.bukkit.ChunkSnapshot snapshot)
snapshot
- Cannot be null. The world will not be cached, only the world name.public int getX()
public ChunkLocation setX(int x)
x
- Chunk coordinate x value.public int getZ()
public ChunkLocation setZ(int z)
z
- Chunk coordinate z value.public ChunkLocation add(int x, int z)
x
- Chunk x coordinate value.z
- Chunk z coordinate value.public ChunkLocation subtract(int x, int z)
x
- Chunk x coordinate value.z
- Chunk z coordinate value.public org.bukkit.World getWorld()
public void setWorld(org.bukkit.World world)
world
- Cannot be null.public org.bukkit.Chunk getChunk()
public boolean isLoaded()
public void load()
public boolean exists()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object