Skip to content

API reference Obsidian.API.World.Generator.RandomSources

WorldgenRandom class

Wraps another source and adds vanilla's feature/decoration seeding helpers (vanilla WorldgenRandom). All values are derived from the wrapped source: a LegacyRandomSource supplies bits directly, any other source supplies the top bits of IRandomSource.NextLong.

public sealed class WorldgenRandom : LegacyRandomSource

In Obsidian.API.

Constructors

public WorldgenRandom(IRandomSource randomSource);

Properties

Count

public int Count { get; }

Number of times WorldgenRandom.Next has been called.

Methods

public override IRandomSource Fork();public override IPositionalRandomFactory ForkPositional();public override int Next(int bits);

SetDecorationSeed(long, int, int)

public long SetDecorationSeed(long levelSeed, int minBlockX, int minBlockZ);

Seeds for decorating the chunk whose minimum block corner is (minBlockX, minBlockZ).

Returns

The decoration seed, to be passed to WorldgenRandom.SetFeatureSeed.

SetFeatureSeed(long, int, int)

public void SetFeatureSeed(long decorationSeed, int index, int step);

Seeds for the feature at index within generation step.

SetLargeFeatureSeed(long, int, int)

public void SetLargeFeatureSeed(long levelSeed, int chunkX, int chunkZ);

Seeds for carvers and legacy large features of the given chunk.

SetLargeFeatureWithSalt(long, int, int, int)

public void SetLargeFeatureWithSalt(long levelSeed, int regionX, int regionZ, int salt);

Seeds for structure placement in the given region.

SetSeed(long)

public override void SetSeed(long seed);

Remarks

Only reseeds the wrapped source. Like vanilla, this does not discard a cached gaussian of this wrapper.

On this page