Class ChunkContext
- Namespace
- WorldgenLib
- Assembly
- WorldgenLib.VintageStory.dll
Per-chunk context passed to hooks at steps 0, 1, and 10. Contains region map samples, config values, and mutable taper map.
public sealed class ChunkContext
- Inheritance
-
ChunkContext
- Inherited Members
Constructors
ChunkContext(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, float, int, double, WeightedTaper[], SimplexNoise, float[][], LandformsWorldProperty, LerpedWeightedIndex2DMap, float, float, float, IServerChunk[]?, IMapChunk?, IChunkColumnGenerateRequest?, int, int, int, int)
Creates a ChunkContext with all region-level data needed by hooks. Parameters are grouped: coordinates, region map corners, config, noise, landforms.
public ChunkContext(int chunkX, int chunkZ, int climateUpLeft, int climateUpRight, int climateBotLeft, int climateBotRight, int oceanUpLeft, int oceanUpRight, int oceanBotLeft, int oceanBotRight, int upheavalUpLeft, int upheavalUpRight, int upheavalBotLeft, int upheavalBotRight, int seaLevel, int mapSizeY, float oceanicityFactor, int taperThreshold, double geoUpheavalAmplitude, GenTerraHost.WeightedTaper[] taperMap, SimplexNoise distort2dX, float[][] terrainYThresholds, LandformsWorldProperty landforms, LerpedWeightedIndex2DMap landLerpMap, float chunkPixelSize, float baseX, float baseZ, IServerChunk[]? chunks = null, IMapChunk? mapChunk = null, IChunkColumnGenerateRequest? request = null, int rockBlockId = 0, int freshWaterBlockId = 0, int saltWaterBlockId = 0, int lakeIceBlockId = 0)
Parameters
chunkXintchunkZintclimateUpLeftintclimateUpRightintclimateBotLeftintclimateBotRightintoceanUpLeftintoceanUpRightintoceanBotLeftintoceanBotRightintupheavalUpLeftintupheavalUpRightintupheavalBotLeftintupheavalBotRightintseaLevelintmapSizeYintoceanicityFactorfloattaperThresholdintgeoUpheavalAmplitudedoubletaperMapWeightedTaper[]distort2dXSimplexNoiseterrainYThresholdsfloat[][]landformsLandformsWorldPropertylandLerpMapLerpedWeightedIndex2DMapchunkPixelSizefloatbaseXfloatbaseZfloatchunksIServerChunk[]mapChunkIMapChunkrequestIChunkColumnGenerateRequestrockBlockIdintfreshWaterBlockIdintsaltWaterBlockIdintlakeIceBlockIdint
Properties
BaseX
public float BaseX { get; }
Property Value
BaseZ
public float BaseZ { get; }
Property Value
ChunkPixelSize
public float ChunkPixelSize { get; }
Property Value
ChunkSize
public int ChunkSize { get; }
Property Value
ChunkX
public int ChunkX { get; }
Property Value
ChunkZ
public int ChunkZ { get; }
Property Value
Chunks
Vertical chunks produced for this terrain request.
public IServerChunk[] Chunks { get; }
Property Value
- IServerChunk[]
ClimateBotLeft
public int ClimateBotLeft { get; }
Property Value
ClimateBotRight
public int ClimateBotRight { get; }
Property Value
ClimateUpLeft
public int ClimateUpLeft { get; }
Property Value
ClimateUpRight
public int ClimateUpRight { get; }
Property Value
CustomData
Per-chunk state shared by hooks. Keys must be namespaced by the
owning mod (for example, strata:elevation).
public IDictionary<string, object?> CustomData { get; }
Property Value
Distort2dX
public SimplexNoise Distort2dX { get; }
Property Value
- SimplexNoise
Distort2dZ
public SimplexNoise Distort2dZ { get; }
Property Value
- SimplexNoise
FreshWaterBlockId
Resolved fresh-water block ID.
public int FreshWaterBlockId { get; }
Property Value
GeoUpheavalAmplitude
public double GeoUpheavalAmplitude { get; }
Property Value
GeoUpheavalNoise
public NormalizedSimplexNoise GeoUpheavalNoise { get; }
Property Value
- NormalizedSimplexNoise
LakeIceBlockId
Resolved lake-ice block ID.
public int LakeIceBlockId { get; }
Property Value
LandLerpMap
public LerpedWeightedIndex2DMap LandLerpMap { get; }
Property Value
- LerpedWeightedIndex2DMap
LandformMap
public IntDataMap2D LandformMap { get; }
Property Value
- IntDataMap2D
Landforms
public LandformsWorldProperty Landforms { get; }
Property Value
- LandformsWorldProperty
MapChunk
Map chunk produced for this terrain request.
public IMapChunk MapChunk { get; }
Property Value
- IMapChunk
MapRegion
Region containing the maps used by this terrain request.
public IMapRegion MapRegion { get; }
Property Value
- IMapRegion
MapSizeY
public int MapSizeY { get; }
Property Value
OceanBotLeft
public int OceanBotLeft { get; }
Property Value
OceanBotRight
public int OceanBotRight { get; }
Property Value
OceanUpLeft
public int OceanUpLeft { get; }
Property Value
OceanUpRight
public int OceanUpRight { get; }
Property Value
OceanicityFactor
public float OceanicityFactor { get; }
Property Value
RegionMapSize
public int RegionMapSize { get; }
Property Value
RegionX
public int RegionX { get; }
Property Value
RegionZ
public int RegionZ { get; }
Property Value
Request
The original request, available to a finalization hook.
public IChunkColumnGenerateRequest Request { get; }
Property Value
- IChunkColumnGenerateRequest
RockBlockId
Resolved rock block ID used by the terrain pass.
public int RockBlockId { get; }
Property Value
SaltWaterBlockId
Resolved salt-water block ID.
public int SaltWaterBlockId { get; }
Property Value
SeaLevel
public int SeaLevel { get; }
Property Value
TaperMap
public GenTerraHost.WeightedTaper[] TaperMap { get; set; }
Property Value
TaperThreshold
public int TaperThreshold { get; }
Property Value
TerrainNoise
public NewNormalizedSimplexFractalNoise TerrainNoise { get; }
Property Value
- NewNormalizedSimplexFractalNoise
TerrainYThresholds
public float[][] TerrainYThresholds { get; }
Property Value
- float[][]
UpheavalBotLeft
public int UpheavalBotLeft { get; }
Property Value
UpheavalBotRight
public int UpheavalBotRight { get; }
Property Value
UpheavalUpLeft
public int UpheavalUpLeft { get; }
Property Value
UpheavalUpRight
public int UpheavalUpRight { get; }
Property Value
Methods
GetOrCreateCustomData<T>(string, Func<T>)
Gets a typed per-request value, creating it once if absent. The collection is safe to initialize from parallel column hooks; the value itself remains owned by the consumer and must be partitioned or synchronized by that consumer.
public T GetOrCreateCustomData<T>(string key, Func<T> factory)
Parameters
Returns
- T
Type Parameters
T
SetChunkModdata<T>(string, T)
Write generic moddata to the first generated chunk.
public void SetChunkModdata<T>(string key, T data)
Parameters
keystringdataT
Type Parameters
T
SetMapChunkModdata<T>(string, T)
Write generic moddata to the generated map chunk.
public void SetMapChunkModdata<T>(string key, T data)
Parameters
keystringdataT
Type Parameters
T
TryGetCustomData<T>(string, out T?)
Try to read typed per-request state without creating it.
public bool TryGetCustomData<T>(string key, out T? value)
Parameters
keystringvalueT
Returns
Type Parameters
T