Table of Contents

Class BlockChunk

Namespace
Shard.Gameplay.Universe.World.Chunks
Assembly
Shard.Gameplay.Universe.dll

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

bool

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

i BlockIndex

The block's index.

block int

The new block type.

rotation BlockRotation

The new rotation.

filler BlockFiller

The new filler offset.

oldRotation BlockRotation

The previous rotation.

oldFiller BlockFiller

The 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

i BlockIndex

The 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

i BlockIndex

The block's index.

rotation BlockRotation

The block's rotation.

filler BlockFiller

The 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

i BlockIndex

The block's index.

block int

The new type.

rotation BlockRotation

The new rotation. Defaults to 0 (default rotation).

filler BlockFiller

The 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

position ChunkPos

The chunk's coordinates.

Returns

SetChunk

A packet containing the chunk's current state.