Table of Contents

Class TransitionableProperties

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

This is a versatile way of allowing a collectible to change to another after a certain time in the inventory.

public class TransitionableProperties
Inheritance
TransitionableProperties
Inherited Members
Extension Methods

Examples

"transitionablePropsByType": {
	"*-long-raw": [
		{
			"type": "Dry",
			"freshHours": { "avg": 0 },
			"transitionHours": { "avg": 168 },
			"transitionedStack": {
				"type": "item",
				"code": "bowstave-long-dry"
			},
			"transitionRatio": 1
		}
	]
},
"transitionableProps": [
	{
		"type": "Perish",
		"freshHours": { "avg": 120 },
		"transitionHours": { "avg": 24 },
		"transitionedStack": {
			"type": "item",
			"code": "rot"
		},
		"transitionRatio": 0.5
	}
],

Fields

FreshHours

The amount of hours before this item starts the transitioning process.

public NatFloat FreshHours

Field Value

NatFloat

TransitionHours

The amount of hours it takes for the item to transition, after FreshHours has elapsed.

public NatFloat TransitionHours

Field Value

NatFloat

TransitionRatio

Conversion ratio of fresh stacksize to transitioned stack size

public float TransitionRatio

Field Value

float

TransitionedStack

The itemstack the collectible turns into upon transitioning.

public JsonItemStack TransitionedStack

Field Value

JsonItemStack

Type

What kind of transition can it make?

public EnumTransitionType Type

Field Value

EnumTransitionType

Methods

Clone()

Duplicates the properties, which includes cloning the stack that was eaten.

public TransitionableProperties Clone()

Returns

TransitionableProperties

FromBytes(BinaryReader, IClassRegistryAPI)

public void FromBytes(BinaryReader reader, IClassRegistryAPI instancer)

Parameters

reader BinaryReader
instancer IClassRegistryAPI

ToBytes(BinaryWriter)

public void ToBytes(BinaryWriter writer)

Parameters

writer BinaryWriter