Table of Contents

Interface IMapRegion

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

2D Map data for a 16x16 area of chunk columns. Holds a few maps for the chunk generation.

public interface IMapRegion
Extension Methods

Properties

BeachMap

Holds a beach strength map

IntDataMap2D BeachMap { get; set; }

Property Value

IntDataMap2D

BlockPatchMaps

Density maps for block patches

Dictionary<string, IntDataMap2D> BlockPatchMaps { get; set; }

Property Value

Dictionary<string, IntDataMap2D>

ClimateMap

Holds temperature and rain fall.
16-23 bits = Red = temperature
8-15 bits = Green = rain
0-7 bits = Blue = unused

IntDataMap2D ClimateMap { get; set; }

Property Value

IntDataMap2D

DirtyForSaving

bool DirtyForSaving { get; set; }

Property Value

bool

FlowerMap

Currently unuseds

IntDataMap2D FlowerMap { get; set; }

Property Value

IntDataMap2D

ForestMap

Holds a forest density map

IntDataMap2D ForestMap { get; set; }

Property Value

IntDataMap2D

GeneratedStructures

List of structures that were generated in this region

List<GeneratedStructure> GeneratedStructures { get; }

Property Value

List<GeneratedStructure>

GeologicProvinceMap

Holds the geologic province indices

IntDataMap2D GeologicProvinceMap { get; set; }

Property Value

IntDataMap2D

LandformMap

Holds the landform indices

IntDataMap2D LandformMap { get; set; }

Property Value

IntDataMap2D

ModData

Holds the raw mod data.

[Obsolete("Use Get/Set/RemoveModData instead")]
Dictionary<string, byte[]> ModData { get; }

Property Value

Dictionary<string, byte[]>

ModMaps

Holds the mod mappings.

Dictionary<string, IntDataMap2D> ModMaps { get; }

Property Value

Dictionary<string, IntDataMap2D>

OceanMap

IntDataMap2D OceanMap { get; set; }

Property Value

IntDataMap2D

OreMapVerticalDistortBottom

IntDataMap2D OreMapVerticalDistortBottom { get; }

Property Value

IntDataMap2D

OreMapVerticalDistortTop

IntDataMap2D OreMapVerticalDistortTop { get; }

Property Value

IntDataMap2D

OreMaps

Gets the ore map for the given item.

Dictionary<string, IntDataMap2D> OreMaps { get; }

Property Value

Dictionary<string, IntDataMap2D>

RockStrata

Holds the rock strata noise maps

IntDataMap2D[] RockStrata { get; set; }

Property Value

IntDataMap2D[]

ShrubMap

Holds a shrub density map

IntDataMap2D ShrubMap { get; set; }

Property Value

IntDataMap2D

UpheavelMap

IntDataMap2D UpheavelMap { get; set; }

Property Value

IntDataMap2D

Methods

AddGeneratedStructure(GeneratedStructure)

A thread-safe way to add a new GeneratedStructure, also marks DirtyForSaving = true

void AddGeneratedStructure(GeneratedStructure generatedStructure)

Parameters

generatedStructure GeneratedStructure

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)

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)

Parameters

key string

Returns

T

Type Parameters

T

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

SetModdata(string, byte[])

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

void SetModdata(string key, byte[] data)

Parameters

key string
data byte[]

Use SerializerUtil to encode your data to bytes

SetModdata<T>(string, T)

Server: Allows setting of arbitrary, permanantly stored moddata of this map region. 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