java.lang.Object
at.syntaxerror.syntaxnbt.region.Chunk
A structure holding information about one Minecraft chunk (16x384x16 blocks)
- Author:
- SyntaxError404
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the world generation status of this chunk. -
Constructor Summary
ConstructorsConstructorDescriptionChunk()Constructs a new empty chunk.Chunk(TagCompound raw) Constructs a new chunk from a compound tag -
Method Summary
Modifier and TypeMethodDescriptionReturns the compression scheme used for this chunkgetData()Returns the chunk data.booleanisDirty()Checks whether this chunk is marked as dirty (has been changed since last serialization)byte[]serialize(NBTCompression compression) Deprecated.internal use onlysetCompression(NBTCompression compression) Sets the compression scheme used for this chunk.setDirty(boolean dirty) Sets whether this chunk is marked as dirty (has been changed since last serialization).setRaw(TagCompound data) Overrides the chunk data in this chunk
-
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
Constructs a new chunk from a compound tag- Parameters:
raw- the chunk data
-
-
Method Details
-
setDirty
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
Sets the compression scheme used for this chunk. Ifnull, the scheme defined by the Region (Region.getCompression()) is used instead.- Parameters:
compression- the compression scheme used for this chunk- Returns:
- this chunk
-
setRaw
Overrides the chunk data in this chunk- Parameters:
data- the chunk data- Returns:
- this chunk
-
serialize
Deprecated.internal use onlySerializes this chunk. Do not alter the returned byte array!- Parameters:
compression- the default compression scheme- Returns:
- the serialized data
-
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
Returns the compression scheme used for this chunk- Returns:
- the compression scheme
-