Skip to content

API reference Obsidian.API.World.Features.Trees

TreeContext class

One tree being placed by a minecraft:tree feature, which it passes to its trunk, foliage and root placers.

public abstract class TreeContext

In Obsidian.API.

Remarks

Like the setters vanilla's TreeFeature.place hands to its placers, every block set through the context is written to the level and recorded as part of the tree, for its decorators and the leaf distance update that follow. Only the server creates contexts.

Properties

DirtProvider

public abstract IBlockStateProvider DirtProvider { get; }

The tree feature's dirt_provider, placed under the trunk.

FoliageProvider

public abstract IBlockStateProvider FoliageProvider { get; }

The tree feature's foliage_provider, for leaves.

ForceDirt

public abstract bool ForceDirt { get; }

Whether the block under the trunk is replaced with TreeContext.DirtProvider even when it's dirt.

public abstract WorldGenerationContext Generation { get; }public abstract IWorldGenLevel Level { get; }public abstract IRandomSource Random { get; }

TrunkProvider

public abstract IBlockStateProvider TrunkProvider { get; }

The tree feature's trunk_provider, for logs.

Methods

IsFoliageSet(Vector)

public abstract bool IsFoliageSet(Vector position);

Vanilla FoliageSetter.isSet: whether this tree already placed foliage at the position.

SetFoliage(Vector, IBlock)

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

Vanilla FoliageSetter.set.

SetLog(Vector, IBlock)

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

Places a trunk block: a log, or the dirt under the trunk.

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

On this page