Skip to content

API reference Obsidian.API.World

ILevelGenerator interface

public interface ILevelGenerator

In Obsidian.API.

Properties

string Id { get; }

Methods

FindSpawnPointAsync()

ValueTask<VectorD?> FindSpawnPointAsync();

Finds where players spawn in a new level, generating the chunks it needs.

Returns

The spawn position, or null to let the level search its generated chunks.

ValueTask<IChunk> GenerateChunkAsync(int x, int z, IChunk chunk = null, ChunkGenStage stage = 11);void Init(ILevel level);

LockChunkAsync(int, int)

ValueTask<IDisposable> LockChunkAsync(int x, int z);

Locks a chunk against generation while it's saved, so saves never capture a chunk mid-write.

Returns

A handle releasing the lock, or null when the generator doesn't lock chunks.

On this page