Class BlockChunk
Block data for a 32x32x32 block chunk, including block types, rotations, filler offsets and light levels.
public class BlockChunk
- Inheritance
-
BlockChunk
- Inherited Members
Properties
IsEmpty
Whether all blocks in the chunk are type zero, meaning Empty.
public bool IsEmpty { get; }
Property Value
Methods
GetAndSetBlock(BlockIndex, int, BlockRotation, BlockFiller, out BlockRotation, out BlockFiller)
Gets the type, rotation and filler offset at a given index and returns its previous values respectively.
public int GetAndSetBlock(BlockIndex i, int block, BlockRotation rotation, BlockFiller filler, out BlockRotation oldRotation, out BlockFiller oldFiller)
Parameters
iBlockIndexThe block's index.
blockintThe new block type.
rotationBlockRotationThe new rotation.
fillerBlockFillerThe new filler offset.
oldRotationBlockRotationThe previous rotation.
oldFillerBlockFillerThe previous filler offset.
Returns
- int
The previous block type.
- See Also
GetBlock(BlockIndex)
Gets the type of block at a given index.
public int GetBlock(BlockIndex i)
Parameters
iBlockIndexThe block's index.
Returns
- int
The block type.
GetBlock(BlockIndex, out BlockRotation, out BlockFiller)
Gets the type, rotation and filler offset at a given index.
public int GetBlock(BlockIndex i, out BlockRotation rotation, out BlockFiller filler)
Parameters
iBlockIndexThe block's index.
rotationBlockRotationThe block's rotation.
fillerBlockFillerThe block's filler offset.
Returns
- int
The block's type.
SetBlock(BlockIndex, int, BlockRotation, BlockFiller)
Sets the type, rotation and filler offset at a given index.
public void SetBlock(BlockIndex i, int block, BlockRotation rotation = default, BlockFiller filler = default)
Parameters
iBlockIndexThe block's index.
blockintThe new type.
rotationBlockRotationThe new rotation. Defaults to 0 (default rotation).
fillerBlockFillerThe new filler offset. Defaults to 0 (no offset).
ToPacket(ChunkPos)
Builds a Hytale.Protocol.Packets.World.SetChunk packet of the current state.
public SetChunk ToPacket(ChunkPos position)
Parameters
positionChunkPosThe chunk's coordinates.
Returns
- SetChunk
A packet containing the chunk's current state.