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

AnimalSpawnMaps

Density maps for animal spawning

Dictionary<string, ByteDataMap2D> AnimalSpawnMaps { get; set; }

Property Value

Dictionary<string, ByteDataMap2D>

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>

RiversMap

Rivers map for medium rivers

long[] RiversMap { get; set; }

Property Value

long[]

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

TerrainMap

Low-resolution terrain height map

ushort[] TerrainMap { get; set; }

Property Value

ushort[]

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

AddGeneratedStructures(IEnumerable<GeneratedStructure>)

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

void AddGeneratedStructures(IEnumerable<GeneratedStructure> generatedStructure)

Parameters

generatedStructure IEnumerable<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

UpdateLowResTerrainPadding(IMapRegion, int, int, int)

Add a map region's terrainmap data to the padding regions of its neighbor's terrainmap

void UpdateLowResTerrainPadding(IMapRegion mapRegion, int dx, int dz, int mapSize)

Parameters

mapRegion IMapRegion
dx int
dz int
mapSize int