Module syntaxnbt

Class Region

java.lang.Object
at.syntaxerror.syntaxnbt.region.Region

public class Region extends Object
A structure holding a 32x32 area of Chunks
Author:
SyntaxError404
  • Constructor Details

    • Region

      public Region()
      Constructs a new region
  • Method Details

    • getChunk

      public Chunk getChunk(int x, int z)
      Returns a specific chunk. A value of null suggest that the chunk has not been generated yet.
      Parameters:
      x - chunk's X position (0 >= x < 32)
      z - chunk's Z position (0 >= z < 32)
      Returns:
      a specific chunk
    • setChunk

      public Region setChunk(int x, int z, Chunk chunk)
      Overrides a specific chunk
      Parameters:
      x - chunk's X position (0 >= x < 32)
      z - chunk's Z position (0 >= z < 32)
      chunk - new chunk
      Returns:
      this region
    • getTimestamp

      public int getTimestamp(int x, int z)
      Returns the timestamp for a specific chunk
      Parameters:
      x - chunk's X position (0 >= x < 32)
      z - chunk's Z position (0 >= z < 32)
      Returns:
      the timestamp for a specific chunk
    • setTimestamp

      public Region setTimestamp(int x, int z, int time)
      Overrides the timestamp for a specific chunk
      Parameters:
      x - chunk's X position (0 >= x < 32)
      z - chunk's Z position (0 >= z < 32)
      time - new timestamp
      Returns:
      this region
    • getCompression

      @NonNull public @NonNull NBTCompression getCompression()
      Returns the default compression scheme for chunks
      Returns:
      the compression scheme
    • setCompression

      public void setCompression(@NonNull @NonNull NBTCompression compression)
      Sets the default compression scheme for chunks
      Parameters:
      compression - the compression scheme