Package tk.airshipcraft.commonlib.world
Class PseudoChunk
java.lang.Object
tk.airshipcraft.commonlib.world.PseudoChunk
Represents a chunk-like structure that holds the coordinates for a chunk in a world without storing the actual chunk data.
This is useful for representing chunk locations without the overhead of the actual chunk data in memory.
- Since:
- 2023-03-30
- Version:
- 1.0.0
- Author:
- notzune
-
Constructor Summary
ConstructorsConstructorDescriptionPseudoChunk(org.bukkit.World world, int x, int z) Constructs a newPseudoChunkwith the given world and chunk coordinates. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.ChunkRetrieves the actualChunkobject that this pseudo chunk represents from the world.intGets the actual x-coordinate of the chunk's origin in the world (block coordinate).intGets the actual z-coordinate of the chunk's origin in the world (block coordinate).org.bukkit.WorldgetWorld()Gets the world where this pseudo chunk is located.intgetX()Gets the x-coordinate of this pseudo chunk.intgetZ()Gets the z-coordinate of this pseudo chunk.
-
Constructor Details
-
PseudoChunk
public PseudoChunk(org.bukkit.World world, int x, int z) Constructs a newPseudoChunkwith the given world and chunk coordinates.- Parameters:
world- The world in which this pseudo chunk is located.x- The x-coordinate of the chunk.z- The z-coordinate of the chunk.
-
-
Method Details
-
getX
public int getX()Gets the x-coordinate of this pseudo chunk.- Returns:
- The x-coordinate.
-
getZ
public int getZ()Gets the z-coordinate of this pseudo chunk.- Returns:
- The z-coordinate.
-
getWorld
public org.bukkit.World getWorld()Gets the world where this pseudo chunk is located.- Returns:
- The world.
-
getActualX
public int getActualX()Gets the actual x-coordinate of the chunk's origin in the world (block coordinate).- Returns:
- The actual x-coordinate of the chunk in block coordinates.
-
getActualZ
public int getActualZ()Gets the actual z-coordinate of the chunk's origin in the world (block coordinate).- Returns:
- The actual z-coordinate of the chunk in block coordinates.
-
getActualChunk
public org.bukkit.Chunk getActualChunk()Retrieves the actualChunkobject that this pseudo chunk represents from the world.- Returns:
- The corresponding
Chunkobject.
-