@Immutable public final class ChunkLocation extends Object implements Serializable, Cloneable
One produces a new ChunkLocation using create(int, int)
You may reuse ChunkLocations, but never modify them. This is so Chunks occupying a ChunkLocation within a world cannot chnage its position. This comes at a cost of memory, but offers advantages of low overhead thread-safety and defensive programming.
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
static ChunkLocation |
create(int x,
int z)
Produces a new chunk coordinate using the two positions specified
|
boolean |
equals(Object obj) |
int |
hashCode() |
String |
toString() |
int |
x()
Obtains the X coordinate for the ChunkLocation
|
int |
z()
Obtains the Z coordinate ofr the ChunkLocation
|
public static ChunkLocation create(int x, int z)
x
- the X coordinatez
- the Z coordinatepublic int x()
public int z()
Copyright © 2016. All rights reserved.