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
apiICoreServerAPI
Methods
ForceClimateAt(ForceClimate)
public void ForceClimateAt(ForceClimate climate)
Parameters
climateForceClimate
ForceLandAt(ForceLandform)
public void ForceLandAt(ForceLandform fl)
Parameters
flForceLandform
ForceLandformAt(ForceLandform)
public void ForceLandformAt(ForceLandform landform)
Parameters
landformForceLandform
ForceRandomLandArea(int, int, int)
public void ForceRandomLandArea(int positionX, int positionZ, int radius)
Parameters
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
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
stepMapGeneratorStep
Returns
- MapLayerBase
InitWorldGen(bool)
public void InitWorldGen(bool preserveRequestedForces = false)
Parameters
preserveRequestedForcesbool
OnMapRegionGen(IMapRegion, int, int, ITreeAttribute)
public void OnMapRegionGen(IMapRegion mapRegion, int regionX, int regionZ, ITreeAttribute chunkGenParams)
Parameters
RegisterBeachHook(string, double, MapsStepHook)
public void RegisterBeachHook(string modId, double order, MapsStepHook hook)
Parameters
modIdstringorderdoublehookMapsStepHook
RegisterBiomeHook(string, double, MapsStepHook)
public void RegisterBiomeHook(string modId, double order, MapsStepHook hook)
Parameters
modIdstringorderdoublehookMapsStepHook
RegisterClimateHook(string, double, MapsStepHook)
public void RegisterClimateHook(string modId, double order, MapsStepHook hook)
Parameters
modIdstringorderdoublehookMapsStepHook
RegisterForestHook(string, double, MapsStepHook)
public void RegisterForestHook(string modId, double order, MapsStepHook hook)
Parameters
modIdstringorderdoublehookMapsStepHook
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
modIdstringorderdoublehookMapRegionGenerationHook
RegisterGeoprovinceHook(string, double, MapsStepHook)
public void RegisterGeoprovinceHook(string modId, double order, MapsStepHook hook)
Parameters
modIdstringorderdoublehookMapsStepHook
RegisterLandformHook(string, double, MapsStepHook)
public void RegisterLandformHook(string modId, double order, MapsStepHook hook)
Parameters
modIdstringorderdoublehookMapsStepHook
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
stepMapGeneratorStepmodIdstringorderdoublehookMapGeneratorHook
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
modIdstringorderdoublehookMapPaddingHook
RegisterOceanHook(string, double, MapsStepHook)
public void RegisterOceanHook(string modId, double order, MapsStepHook hook)
Parameters
modIdstringorderdoublehookMapsStepHook
RegisterRegionFinalizeHook(string, double, RegionFinalizeHook)
public void RegisterRegionFinalizeHook(string modId, double order, RegionFinalizeHook hook)
Parameters
modIdstringorderdoublehookRegionFinalizeHook
RegisterShrubHook(string, double, MapsStepHook)
public void RegisterShrubHook(string modId, double order, MapsStepHook hook)
Parameters
modIdstringorderdoublehookMapsStepHook
RegisterUpheavelHook(string, double, MapsStepHook)
public void RegisterUpheavelHook(string modId, double order, MapsStepHook hook)
Parameters
modIdstringorderdoublehookMapsStepHook
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)