Table of Contents

Class GenMapsHost

Namespace
WorldgenLib
Assembly
WorldgenLib.VintageStory.dll

Faithful reimplementation of vanilla GenMaps server-side behavior. Generates the nine region maps (geoprovince, climate, forest, upheavel, ocean, beach, shrub, biome, landform) plus the force mechanisms and the client latitude channel.

When no hooks are registered, the output is byte-identical to vanilla for the same seed and config. Consumer mods register effects at the nine map steps or at RegionFinalize.

The static factory methods (GetClimateMapGen, GetOceanMapGen, etc.) are called on the vanilla GenMaps class — they are public static and do not depend on GenMaps instance state.

public sealed class GenMapsHost
Inheritance
GenMapsHost
Inherited Members

Constructors

GenMapsHost(ICoreServerAPI)

public GenMapsHost(ICoreServerAPI api)

Parameters

api ICoreServerAPI

Methods

ForceClimateAt(ForceClimate)

public void ForceClimateAt(ForceClimate climate)

Parameters

climate ForceClimate

ForceLandAt(ForceLandform)

public void ForceLandAt(ForceLandform fl)

Parameters

fl ForceLandform

ForceLandformAt(ForceLandform)

public void ForceLandformAt(ForceLandform landform)

Parameters

landform ForceLandform

ForceRandomLandArea(int, int, int)

public void ForceRandomLandArea(int positionX, int positionZ, int radius)

Parameters

positionX int
positionZ int
radius int

FreezeHooks()

Freeze all hook lists. Called once after all StartServerSide have run.

public void FreezeHooks()

GetHookReport()

Get a diagnostic report of all registered GenMaps hooks.

public IReadOnlyList<(string Step, double Order, string ModId)> GetHookReport()

Returns

IReadOnlyList<(string Step, double Order, string ModId)>

GetMapGenerator(MapGeneratorStep)

Return the generator currently used for a map step. Consumers that need to wrap a vanilla chain should use RegisterMapGenerator during startup; this accessor is for diagnostics and terminal adapters.

public MapLayerBase GetMapGenerator(MapGeneratorStep step)

Parameters

step MapGeneratorStep

Returns

MapLayerBase

InitWorldGen(bool)

public void InitWorldGen(bool preserveRequestedForces = false)

Parameters

preserveRequestedForces bool

OnMapRegionGen(IMapRegion, int, int, ITreeAttribute)

public void OnMapRegionGen(IMapRegion mapRegion, int regionX, int regionZ, ITreeAttribute chunkGenParams)

Parameters

mapRegion IMapRegion
regionX int
regionZ int
chunkGenParams ITreeAttribute

RegisterBeachHook(string, double, MapsStepHook)

public void RegisterBeachHook(string modId, double order, MapsStepHook hook)

Parameters

modId string
order double
hook MapsStepHook

RegisterBiomeHook(string, double, MapsStepHook)

public void RegisterBiomeHook(string modId, double order, MapsStepHook hook)

Parameters

modId string
order double
hook MapsStepHook

RegisterClimateHook(string, double, MapsStepHook)

public void RegisterClimateHook(string modId, double order, MapsStepHook hook)

Parameters

modId string
order double
hook MapsStepHook

RegisterForestHook(string, double, MapsStepHook)

public void RegisterForestHook(string modId, double order, MapsStepHook hook)

Parameters

modId string
order double
hook MapsStepHook

RegisterFullRegionGeneration(string, double, MapRegionGenerationHook)

Register a terminal complete-region generator for migrations that need custom map stages beyond the nine vanilla maps. Returning true owns the region; returning false composes with the next hook and then with WorldgenLib's standard pass.

public void RegisterFullRegionGeneration(string modId, double order, MapRegionGenerationHook hook)

Parameters

modId string
order double
hook MapRegionGenerationHook

RegisterGeoprovinceHook(string, double, MapsStepHook)

public void RegisterGeoprovinceHook(string modId, double order, MapsStepHook hook)

Parameters

modId string
order double
hook MapsStepHook

RegisterLandformHook(string, double, MapsStepHook)

public void RegisterLandformHook(string modId, double order, MapsStepHook hook)

Parameters

modId string
order double
hook MapsStepHook

RegisterMapGenerator(MapGeneratorStep, string, double, MapGeneratorHook)

Register a wrapper/replacement for a vanilla map generator.

public void RegisterMapGenerator(MapGeneratorStep step, string modId, double order, MapGeneratorHook hook)

Parameters

step MapGeneratorStep
modId string
order double
hook MapGeneratorHook

RegisterMapPadding(string, double, MapPaddingHook)

Register a safe replacement for one map stage's padding constant.

public void RegisterMapPadding(string modId, double order, MapPaddingHook hook)

Parameters

modId string
order double
hook MapPaddingHook

RegisterOceanHook(string, double, MapsStepHook)

public void RegisterOceanHook(string modId, double order, MapsStepHook hook)

Parameters

modId string
order double
hook MapsStepHook

RegisterRegionFinalizeHook(string, double, RegionFinalizeHook)

public void RegisterRegionFinalizeHook(string modId, double order, RegionFinalizeHook hook)

Parameters

modId string
order double
hook RegionFinalizeHook

RegisterShrubHook(string, double, MapsStepHook)

public void RegisterShrubHook(string modId, double order, MapsStepHook hook)

Parameters

modId string
order double
hook MapsStepHook

RegisterUpheavelHook(string, double, MapsStepHook)

public void RegisterUpheavelHook(string modId, double order, MapsStepHook hook)

Parameters

modId string
order double
hook MapsStepHook

RequireLandAt(int, int)

Require an ocean map coordinate to be generated as land. Calls made before InitWorldGen are queued and replayed before the ocean layer is assembled, matching the vanilla force lifecycle.

public void RequireLandAt(int x, int z)

Parameters

x int
z int