Table of Contents

Class RegionContext

Namespace
WorldgenLib
Assembly
WorldgenLib.VintageStory.dll

Per-region context passed to GenMaps hooks at steps 1–9 and RegionFinalize. Contains the map region, noise sizes, and mutable map data.

public sealed class RegionContext
Inheritance
RegionContext
Inherited Members

Constructors

RegionContext(int, int, IMapRegion, int, int, int, int, int, int, int, int, Action<ForceLandform>?, Action<ForceClimate>?, Action<int, int>?, ICoreServerAPI?, Func<MapGeneratorStep, MapLayerBase>?)

public RegionContext(int regionX, int regionZ, IMapRegion mapRegion, int noiseSizeGeoProv, int noiseSizeClimate, int noiseSizeForest, int noiseSizeUpheavel, int noiseSizeOcean, int noiseSizeBeach, int noiseSizeShrubs, int noiseSizeLandform, Action<ForceLandform>? forceLandform = null, Action<ForceClimate>? forceClimate = null, Action<int, int>? requireLand = null, ICoreServerAPI? serverApi = null, Func<MapGeneratorStep, MapLayerBase>? getMapGenerator = null)

Parameters

regionX int
regionZ int
mapRegion IMapRegion
noiseSizeGeoProv int
noiseSizeClimate int
noiseSizeForest int
noiseSizeUpheavel int
noiseSizeOcean int
noiseSizeBeach int
noiseSizeShrubs int
noiseSizeLandform int
forceLandform Action<ForceLandform>
forceClimate Action<ForceClimate>
requireLand Action<int, int>
serverApi ICoreServerAPI
getMapGenerator Func<MapGeneratorStep, MapLayerBase>

Properties

ChunkGenParams

Parameters supplied by the worldgen request, when any.

public ITreeAttribute? ChunkGenParams { get; }

Property Value

ITreeAttribute

CurrentMap

Map produced by the current step. A hook may replace this reference; the host writes it back to the corresponding region property after the chain completes.

public IntDataMap2D? CurrentMap { get; set; }

Property Value

IntDataMap2D

MapRegion

public IMapRegion MapRegion { get; }

Property Value

IMapRegion

NoiseSizeBeach

public int NoiseSizeBeach { get; }

Property Value

int

NoiseSizeClimate

public int NoiseSizeClimate { get; }

Property Value

int

NoiseSizeForest

public int NoiseSizeForest { get; }

Property Value

int

NoiseSizeGeoProv

public int NoiseSizeGeoProv { get; }

Property Value

int

NoiseSizeLandform

public int NoiseSizeLandform { get; }

Property Value

int

NoiseSizeOcean

public int NoiseSizeOcean { get; }

Property Value

int

NoiseSizeShrubs

public int NoiseSizeShrubs { get; }

Property Value

int

NoiseSizeUpheavel

public int NoiseSizeUpheavel { get; }

Property Value

int

RegionX

public int RegionX { get; }

Property Value

int

RegionZ

public int RegionZ { get; }

Property Value

int

ServerApi

public ICoreServerAPI? ServerApi { get; }

Property Value

ICoreServerAPI

Methods

ForceClimateAt(ForceClimate)

Queue a forced climate value.

public void ForceClimateAt(ForceClimate climate)

Parameters

climate ForceClimate

ForceLandformAt(ForceLandform)

Queue a forced landform.

public void ForceLandformAt(ForceLandform landform)

Parameters

landform ForceLandform

GetMap(RegionMapSlot)

Get a persistent custom map registered for this region.

public IntDataMap2D GetMap(RegionMapSlot slot)

Parameters

slot RegionMapSlot

Returns

IntDataMap2D

GetMapGenerator(MapGeneratorStep)

Gets the generator currently assembled for a map stage. This is available to a full-region adapter after worldgen initialization.

public MapLayerBase GetMapGenerator(MapGeneratorStep step)

Parameters

step MapGeneratorStep

Returns

MapLayerBase

RequireLandAt(int, int)

Require land at an ocean map coordinate.

public void RequireLandAt(int x, int z)

Parameters

x int
z int