Package com.plotsquared.core.util
Class ChunkUtil
java.lang.Object
com.plotsquared.core.util.ChunkUtil
This cache is used for world generation and just saves a bit of calculation time when checking if something is in the plot area.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetJ(int x, int y, int z) Get the J value for Chunk block storage from the chunk xyz coordinates.static intgetX(int j) Gets the x coordinate for a specific J value for a ChunkSection 16x16x16 xyz Array[4096].static intgetY(int i, int j) Gets the y coordinate for specific I and J values for a Chunk Nx16x16x16 layerxyz Array[N][4096].static intgetZ(int j) Gets the z coordinate for a specific J value for a ChunkSection 16x16x16 xyz Array[4096].
-
Method Details
-
getJ
Get the J value for Chunk block storage from the chunk xyz coordinates. J is in the range 0 to 4095 where it represents a position in an array of 16x16x16 xyz (ChunkSection Array[4096]).- Parameters:
x- Relative x coordinatey- Relative y coordinatez- Relative z coordinate- Returns:
- J value for xyz position in Array[4096].
-
getX
Gets the x coordinate for a specific J value for a ChunkSection 16x16x16 xyz Array[4096].- Parameters:
j- Position in the xyz Array[4096].- Returns:
- x coordinate within the chunk
-
getY
Gets the y coordinate for specific I and J values for a Chunk Nx16x16x16 layerxyz Array[N][4096].- Parameters:
i- Relative layer of the position in the layerxyz Array[16][4096]. May be negative.j- Position in the xyz Array[4096].- Returns:
- x coordinate within the chunk
-
getZ
Gets the z coordinate for a specific J value for a ChunkSection 16x16x16 xyz Array[4096].- Parameters:
j- Position in the xyz Array[4096].- Returns:
- z coordinate within the chunk
-