Class PseudoChunk

java.lang.Object
tk.airshipcraft.commonlib.world.PseudoChunk

public class PseudoChunk extends Object
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

    Constructors
    Constructor
    Description
    PseudoChunk(org.bukkit.World world, int x, int z)
    Constructs a new PseudoChunk with the given world and chunk coordinates.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.Chunk
    Retrieves the actual Chunk object that this pseudo chunk represents from the world.
    int
    Gets the actual x-coordinate of the chunk's origin in the world (block coordinate).
    int
    Gets the actual z-coordinate of the chunk's origin in the world (block coordinate).
    org.bukkit.World
    Gets the world where this pseudo chunk is located.
    int
    Gets the x-coordinate of this pseudo chunk.
    int
    Gets the z-coordinate of this pseudo chunk.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PseudoChunk

      public PseudoChunk(org.bukkit.World world, int x, int z)
      Constructs a new PseudoChunk with 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 actual Chunk object that this pseudo chunk represents from the world.
      Returns:
      The corresponding Chunk object.