Module syntaxnbt

Class Chunk

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

public class Chunk extends Object
A structure holding information about one Minecraft chunk (16x384x16 blocks)
Author:
SyntaxError404
  • Constructor Details

    • Chunk

      public Chunk()
      Constructs a new empty chunk. The data within this chunk is an empty compound tag and therefore not compatible with the default Minecraft client
    • Chunk

      public Chunk(TagCompound raw)
      Constructs a new chunk from a compound tag
      Parameters:
      raw - the chunk data
  • Method Details

    • setDirty

      public Chunk setDirty(boolean dirty)
      Sets whether this chunk is marked as dirty (has been changed since last serialization).
      Parameters:
      dirty - whether this chunk is marked as dirty
      Returns:
      this chunk
    • setCompression

      public Chunk setCompression(NBTCompression compression)
      Sets the compression scheme used for this chunk. If null, the scheme defined by the Region (Region.getCompression()) is used instead.
      Parameters:
      compression - the compression scheme used for this chunk
      Returns:
      this chunk
    • setRaw

      public Chunk setRaw(TagCompound data)
      Overrides the chunk data in this chunk
      Parameters:
      data - the chunk data
      Returns:
      this chunk
    • serialize

      @Deprecated public byte[] serialize(NBTCompression compression)
      Deprecated.
      internal use only
      Serializes this chunk. Do not alter the returned byte array!
      Parameters:
      compression - the default compression scheme
      Returns:
      the serialized data
    • getData

      public TagCompound getData()
      Returns the chunk data. After making changes to this tag (or any of its sub-tags), setDirty(true) has to be called in order to apply those changes.
      Returns:
      the chunk data
    • isDirty

      public boolean isDirty()
      Checks whether this chunk is marked as dirty (has been changed since last serialization)
      Returns:
      whether this chunk is marked as dirty
    • getCompression

      public NBTCompression getCompression()
      Returns the compression scheme used for this chunk
      Returns:
      the compression scheme