Package redempt.redlib.blockdata
Class ChunkPosition
java.lang.Object
redempt.redlib.blockdata.ChunkPosition
Represents a world and chunk X and Z
-
Constructor Summary
ConstructorDescriptionChunkPosition
(int x, int z, String world) Creates a ChunkPosition from chunk coordinates and a world nameChunkPosition
(org.bukkit.block.Block block) Creates a ChunkPosition from a BlockChunkPosition
(org.bukkit.Chunk chunk) Creates a ChunkPosition from a chunkChunkPosition
(redempt.redlib.blockdata.BlockPosition bPos, String world) -
Method Summary
-
Constructor Details
-
ChunkPosition
public ChunkPosition(org.bukkit.Chunk chunk) Creates a ChunkPosition from a chunk- Parameters:
chunk
- The chunk to create a position for
-
ChunkPosition
public ChunkPosition(org.bukkit.block.Block block) Creates a ChunkPosition from a Block- Parameters:
block
- The Block to create a position for
-
ChunkPosition
Creates a ChunkPosition from chunk coordinates and a world name- Parameters:
x
- The chunk Xz
- The chunk Zworld
- The world name
-
ChunkPosition
-
-
Method Details
-
getX
public int getX()- Returns:
- The chunk X
-
getZ
public int getZ()- Returns:
- The chunk Z
-
getWorld
public org.bukkit.World getWorld()- Returns:
- The world this ChunkPosition is in
-
getWorldName
- Returns:
- The name of the world this ChunkPosition is in
-
getChunk
public org.bukkit.Chunk getChunk()Gets the chunk- Returns:
- The chunk at this position
- Throws:
IllegalStateException
- if the world is not loaded
-
hashCode
public int hashCode() -
toString
-
equals
-