Table of Contents

Interface IBulkBlockAccessor

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

Useful for setting many blocks at once efficiently

public interface IBulkBlockAccessor : IBlockAccessor
Inherited Members

Properties

ReadFromStagedByDefault

If set to true, the methods GetBlock() and GetBlockId() will behave like GetStagedBlockId() until the next commit

bool ReadFromStagedByDefault { get; set; }

Property Value

bool

StagedBlocks

The full list of staged blocks that will get commited after calling Commit()

Dictionary<BlockPos, BlockUpdate> StagedBlocks { get; }

Property Value

Dictionary<BlockPos, BlockUpdate>

Methods

GetStagedBlockId(int, int, int)

Gets the block for a not yet commited block. If no block has been staged for this pos the original block is returned

int GetStagedBlockId(int posX, int posY, int posZ)

Parameters

posX int
posY int
posZ int

Returns

int

GetStagedBlockId(BlockPos)

Gets the block for a not yet commited block. If no block has been staged for this pos the original block is returned

int GetStagedBlockId(BlockPos pos)

Parameters

pos BlockPos

Returns

int

PostCommitCleanup(List<BlockUpdate>)

Used to fix certain things like flowing water from the edge of a pasted schematic/selection when undone or /we delete is used

void PostCommitCleanup(List<BlockUpdate> updatedBlocks)

Parameters

updatedBlocks List<BlockUpdate>

SetChunks(Vec2i, IWorldChunk[])

Implemented only by BlockAccessorMapChunkLoading

void SetChunks(Vec2i chunkCoord, IWorldChunk[] chunksCol)

Parameters

chunkCoord Vec2i
chunksCol IWorldChunk[]

SetDecorsBulk(long, Dictionary<int, Block>)

void SetDecorsBulk(long chunkIndex, Dictionary<int, Block> newDecors)

Parameters

chunkIndex long
newDecors Dictionary<int, Block>

Events

BeforeCommit

event Action<IBulkBlockAccessor> BeforeCommit

Event Type

Action<IBulkBlockAccessor>