Class LandformRegistry
- Namespace
- WorldgenLib
- Assembly
- WorldgenLib.VintageStory.dll
Canonical registry for vanilla and custom landform variants.
Vanilla landforms are imported before consumer StartServerSide methods are called. Custom variants are appended to the same Vintagestory.ServerMods.NoObf.LandformsWorldProperty.LandFormsByIndex array, initialized with the current world height, and therefore receive the same numeric index used by the terrain host. A later vanilla landform reload is rebound automatically through Reload().
public static class LandformRegistry
- Inheritance
-
LandformRegistry
- Inherited Members
Properties
All
All vanilla and custom landforms in canonical index order.
public static IReadOnlyList<LandformRegistry.RegisteredLandform> All { get; }
Property Value
IsFrozen
Whether registration is closed for this worldgen run.
public static bool IsFrozen { get; }
Property Value
Landforms
The active canonical vanilla/custom property.
public static LandformsWorldProperty Landforms { get; }
Property Value
- LandformsWorldProperty
Methods
GetByCode(string)
Get a registered landform by canonical code.
public static LandformVariant? GetByCode(string code)
Parameters
codestring
Returns
- LandformVariant
GetIndex(string)
Get a canonical landform index, or -1 when absent.
public static int GetIndex(string code)
Parameters
codestring
Returns
GetTerrainOctaveThresholds(int)
Get the terrain octave thresholds for a landform.
public static double[] GetTerrainOctaveThresholds(int landformIndex)
Parameters
landformIndexint
Returns
- double[]
GetTerrainOctaves(int)
Get the terrain octave amplitudes for a landform.
public static double[] GetTerrainOctaves(int landformIndex)
Parameters
landformIndexint
Returns
- double[]
GetThresholds(int)
Get the interpolated Y threshold array for a landform.
public static float[] GetThresholds(int landformIndex)
Parameters
landformIndexint
Returns
- float[]
Register(string, LandformVariant)
Register a custom landform variant and return its canonical index. Registration is allowed during mod startup, before worldgen init is frozen. The variant must contain the source arrays expected by vanilla LandformVariant.Init.
public static int Register(string code, LandformVariant variant)
Parameters
codestringvariantLandformVariant
Returns
Reload()
Reload vanilla landforms and re-append registered custom variants.
public static void Reload()
SetThresholds(int, float[])
Replace a landform's interpolated thresholds. The array is used by the active terrain host, so it must have exactly MapSizeY elements.
public static void SetThresholds(int landformIndex, float[] thresholds)