Table of Contents

Interface IMapChunk

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

Holds 2 dimensional data for one chunk column

public interface IMapChunk

Properties

CaveHeightDistort

byte[] CaveHeightDistort { get; set; }

Property Value

byte[]

CurrentPass

The current world generation pass this chunk column is in

EnumWorldGenPass CurrentPass { get; set; }

Property Value

EnumWorldGenPass

MapRegion

The map region this map chunk resides in

IMapRegion MapRegion { get; }

Property Value

IMapRegion

RainHeightMap

The position of the last block that is not rain permeable before the first airblock

ushort[] RainHeightMap { get; }

Property Value

ushort[]

SedimentaryThicknessMap

ushort[] SedimentaryThicknessMap { get; }

Property Value

ushort[]

SnowAccum

ConcurrentDictionary<Vec2i, float> SnowAccum { get; }

Property Value

ConcurrentDictionary<Vec2i, float>

TopRockIdMap

The rock block id of the topmost rock layer

int[] TopRockIdMap { get; }

Property Value

int[]

WorldGenTerrainHeightMap

The position of the last block before the first airblock before world gen pass Vegetation

ushort[] WorldGenTerrainHeightMap { get; }

Property Value

ushort[]

YMax

The highest position of any non-air block

ushort YMax { get; set; }

Property Value

ushort

Methods

GetData(string)

Server: Can be used to retrieve custom data from the map chunk (as previously set by SetModdata) Client: Not implemented. Map chunk Moddata is not synced from server to client

[Obsolete("Use GetModData instead")]
byte[] GetData(string key)

Parameters

key string

Returns

byte[]

GetModdata(string)

Server: Retrieve arbitrary, permanently stored mod data Client: Not implemented. Map chunk Moddata is not synced from server to client

byte[] GetModdata(string key)

Parameters

key string

Returns

byte[]

GetModdata<T>(string, T)

Server: Retrieve arbitrary, permantly stored mod data Client: Not implemented. Map chunk Moddata is not synced from server to client

T GetModdata<T>(string key, T defaultValue = default)

Parameters

key string
defaultValue T

Default value

Returns

T

Type Parameters

T

MarkDirty()

Tells the server that it has to save the changes of this chunk to disk. No effect when called client side.

void MarkDirty()

MarkFresh()

Causes the TTL counter to reset so that it the mapchunk does not unload. No effect when called client side.

void MarkFresh()

RemoveModdata(string)

Server: Removes the permanently stored data. Client: Not implemented. Map chunk Moddata is not synced from server to client

void RemoveModdata(string key)

Parameters

key string

SetData(string, byte[])

Server: Can be used to store custom data along with the map chunk Client: Not implemented. Map chunk Moddata is not synced from server to client

[Obsolete("Use SetModData instead")]
void SetData(string key, byte[] data)

Parameters

key string
data byte[]

SetModdata(string, byte[])

Server: Allows setting of arbitrary, permanently stored moddata of this map chunk. Client: Not implemented. Map chunk Moddata is not synced from server to client

void SetModdata(string key, byte[] data)

Parameters

key string
data byte[]

SetModdata<T>(string, T)

Server: Allows setting of arbitrary, permanantly stored moddata of this map chunk. Client: Not implemented. Map chunk Moddata is not synced from server to client

void SetModdata<T>(string key, T data)

Parameters

key string
data T

Type Parameters

T