Table of Contents

Class WorldgenLibMod

Namespace
WorldgenLib
Assembly
WorldgenLib.VintageStory.dll

WorldgenLib mod entry point. Registers as a ModSystem and installs the worldgen hosts (GenMapsHost, GenTerraHost, GenTerraPostProcessHost, GenBlockLayersHost) when no conflicting full-replacement generator is detected. The hosts form one cooperative canonical pass; a foreign takeover is detected before that pass is initialized.

public class WorldgenLibMod : ModSystem
Inheritance
ModSystem
WorldgenLibMod
Inherited Members
ModSystem.ShouldLoad(ICoreAPI)
ModSystem.StartPre(ICoreAPI)
ModSystem.Start(ICoreAPI)
ModSystem.AssetsLoaded(ICoreAPI)
ModSystem.StartClientSide(ICoreClientAPI)
ModSystem.Mod

Methods

AssetsFinalize(ICoreAPI)

When called on a server, all Block.OnLoaded() methods etc. have already been called, this is for any final asset set-up steps to be done after that. See VSSurvivalMod system BlockReinforcement.cs for an example.

public override void AssetsFinalize(ICoreAPI coreApi)

Parameters

coreApi ICoreAPI

Dispose()

If this mod allows runtime reloading, you must implement this method to unregister any listeners / handlers

public override void Dispose()

ExecuteOrder()

If you need mods to be executed in a certain order, adjust this methods return value.
The server will call each Mods StartPre() and Start() methods in ascending order of each mods execute order value. And thus, as long as every mod registers it's event handlers in the Start() method, all event handlers will be called in the same execution order.
Default execute order of some survival mod parts
Worldgen:

  • GenTerra: 0
  • RockStrata: 0.1
  • Deposits: 0.2
  • Caves: 0.3
  • Blocklayers: 0.4
    AssetsLoaded event
  • JsonPatch loader: 0.05
  • Load hardcoded mantle block: 0.1
  • Block and Item Loader: 0.2
  • Recipes (Smithing, Knapping, Clayforming, Grid recipes, Alloys) Loader: 1
public override double ExecuteOrder()

Returns

double

ShouldLoad(EnumAppSide)

Returns if this mod should be loaded for the given app side, called by ShouldLoad(ICoreApi api)

public override bool ShouldLoad(EnumAppSide forSide)

Parameters

forSide EnumAppSide

Returns

bool

StartServerSide(ICoreServerAPI)

Full start to the mod on the server side

Note: preferably, your code which adds or updates behaviors or attributes or other fixed properties of any block, item or entity, should have been run before now. For example, code which needs to do that could be placed in an overridden AssetsFinalize() method. See VSSurvivalMod system BlockReinforcement.cs for an example.

public override void StartServerSide(ICoreServerAPI api)

Parameters

api ICoreServerAPI