Skip to content

API reference Obsidian.API.World.Features.Trees

TreeDecoratorContext class

What a TreeDecorator sees of the placed tree, like vanilla's TreeDecorator.Context. Only the server creates contexts.

public abstract class TreeDecoratorContext

In Obsidian.API.

Remarks

TreeDecoratorContext.Logs, TreeDecoratorContext.Leaves and TreeDecoratorContext.Roots are the tree's positions in the order vanilla iterates them, stable-sorted by Y (lowest first), exactly as vanilla builds them.

Properties

public abstract WorldGenerationContext Generation { get; }public abstract IReadOnlyList<Vector> Leaves { get; }public abstract IWorldGenLevel Level { get; }public abstract IReadOnlyList<Vector> Logs { get; }public abstract IRandomSource Random { get; }public abstract IReadOnlyList<Vector> Roots { get; }

Methods

GetLowestTrunkOrRoot()

public IReadOnlyList<Vector> GetLowestTrunkOrRoot();

Vanilla TreeFeature.getLowestTrunkOrRootOfTree: the logs, the roots, or both when the lowest root and the lowest log share a Y level.

public bool IsAir(Vector position);

PlaceVine(Vector, BlockFace)

public void PlaceVine(Vector position, BlockFace face);

Places a vine attached on face (e.g. BlockFace.East sets east=true).

SetBlock(Vector, IBlock)

public abstract void SetBlock(Vector position, IBlock block);

Places a decoration block; its position counts as part of the tree for the leaf distance and shape updates.

Shuffle<T>(IList<T>, IRandomSource)

public static void Shuffle<T>(IList<T> list, IRandomSource random);

Vanilla Util.shuffle (Fisher-Yates from the end).

On this page