Table of Contents

Class MixIngredientDefinitionBuilder

Namespace
S1API.Items.Ingredient
Assembly
S1API.dll

Builder for composing mixing ingredient definitions at runtime. Use fluent methods to configure the ingredient and its imprinted effects before calling Build().

public sealed class MixIngredientDefinitionBuilder : StorableItemDefinitionBuilderBase<MixIngredientDefinitionBuilder>
Inheritance
MixIngredientDefinitionBuilder
Inherited Members
Extension Methods

Methods

Build()

Builds the ingredient definition, registers it with the game's registry and the mixing-ingredient list, and returns a wrapper. The ingredient is automatically re-applied on subsequent loads.

public MixIngredientDefinition Build()

Returns

MixIngredientDefinition

A wrapper around the created ingredient definition.

Exceptions

InvalidOperationException

Thrown if the ingredient carries no resolved effects.

CopyPropertiesFrom(StorableItemDefinition)

Copies all properties from a source definition to the current definition.

protected override void CopyPropertiesFrom(StorableItemDefinition source)

Parameters

source StorableItemDefinition

The source definition to copy from.

CreateWrapper(StorableItemDefinition)

Creates a wrapper around the given item definition. Subclasses can override this to return a more specific wrapper type.

protected override StorableItemDefinition CreateWrapper(StorableItemDefinition definition)

Parameters

definition StorableItemDefinition

The item definition to wrap.

Returns

StorableItemDefinition

A wrapper around the given item definition.

WithEffect(PropertyBase)

Sets the single effect this ingredient imprints when mixed.

public MixIngredientDefinitionBuilder WithEffect(PropertyBase effect)

Parameters

effect PropertyBase

The effect to imprint (a vanilla token from S1API.Properties.Property or a registered custom effect).

Returns

MixIngredientDefinitionBuilder

The builder instance for fluent chaining.

WithEffects(params PropertyBase[])

Sets the effects this ingredient carries. The first effect is the one applied to the product when mixed.

public MixIngredientDefinitionBuilder WithEffects(params PropertyBase[] effects)

Parameters

effects PropertyBase[]

The effects to carry (vanilla tokens or registered custom effects).

Returns

MixIngredientDefinitionBuilder

The builder instance for fluent chaining.