Table of Contents

Class AdvancedParticleProperties

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

Used to add a set of particle properties to a collectible.

[JsonObject(MemberSerialization.OptIn)]
public class AdvancedParticleProperties : IParticlePropertiesProvider
Inheritance
AdvancedParticleProperties
Implements
Inherited Members
Extension Methods

Fields

Color

When HsvaColor is null, this is used

public int Color

Field Value

int

HsvaColor

The Hue/Saturation/Value/Alpha for the color of the particle.

[JsonProperty]
public NatFloat[] HsvaColor

Field Value

NatFloat[]

PosOffset

Offset from the blocks hitboxes top middle position

[JsonProperty]
public NatFloat[] PosOffset

Field Value

NatFloat[]

basePos

The base position for the particles.

public Vec3d basePos

Field Value

Vec3d

baseVelocity

public Vec3f baseVelocity

Field Value

Vec3f

block

The base block for the particle.

public Block block

Field Value

Block

Properties

Async

If true, will be be spawned in the async particle system, which does not affect main game performance, recommended for large quantities of particles, slightly less optimal for particles that spawn very often

public bool Async { get; }

Property Value

bool

BlueEvolve

A transforming Blue value.

[JsonProperty]
public EvolvingNatFloat BlueEvolve { get; set; }

Property Value

EvolvingNatFloat

Bounciness

The amount of velocity to be kept when this particle collides with something. Directional velocity is multipled by (-Bounciness * 0.65) on any collision.

[JsonProperty]
public float Bounciness { get; set; }

Property Value

float

ColorByBlock

Whether or not to color the particle by the block it's on.

[JsonProperty]
public bool ColorByBlock { get; set; }

Property Value

bool

DeathParticles

More particles that spawn when this particle dies.

[JsonProperty]
public AdvancedParticleProperties[] DeathParticles { get; set; }

Property Value

AdvancedParticleProperties[]

DieInAir

Whether or not the particle dies in air.

[JsonProperty]
public bool DieInAir { get; set; }

Property Value

bool

DieInLiquid

Whether or not the particle dies in water.

[JsonProperty]
public bool DieInLiquid { get; set; }

Property Value

bool

DieOnRainHeightmap

If true, particle dies if it falls below the rain height at its given location

[JsonProperty]
public bool DieOnRainHeightmap { get; set; }

Property Value

bool

GravityEffect

The gravity effect on the particle.

[JsonProperty]
public NatFloat GravityEffect { get; set; }

Property Value

NatFloat

GreenEvolve

A transforming Green value.

[JsonProperty]
public EvolvingNatFloat GreenEvolve { get; set; }

Property Value

EvolvingNatFloat

LifeLength

The life length, in seconds, of the particle.

[JsonProperty]
public NatFloat LifeLength { get; set; }

Property Value

NatFloat

LightEmission

If this particle emits light, this is its RGBA. Does not actually brighten the scene around it, but prevents incorrect lighting of particles when everything else around it is dark

public int LightEmission { get; }

Property Value

int

OpacityEvolve

A transforming opacity value.

[JsonProperty]
public EvolvingNatFloat OpacityEvolve { get; set; }

Property Value

EvolvingNatFloat

ParentVelocity

public Vec3f ParentVelocity { get; set; }

Property Value

Vec3f

ParentVelocityWeight

public float ParentVelocityWeight { get; set; }

Property Value

float

ParticleModel

Sets the base model for the particle.

[JsonProperty]
public EnumParticleModel ParticleModel { get; set; }

Property Value

EnumParticleModel

Pos

Position in the world where the particle should spawn

public Vec3d Pos { get; }

Property Value

Vec3d

Quantity

The quantity of the particles given.

[JsonProperty]
public NatFloat Quantity { get; set; }

Property Value

NatFloat

RandomVelocityChange

Allows each particle to randomly change its velocity over time.

[JsonProperty]
public bool RandomVelocityChange { get; set; }

Property Value

bool

RedEvolve

A transforming Red value.

[JsonProperty]
public EvolvingNatFloat RedEvolve { get; set; }

Property Value

EvolvingNatFloat

SecondaryParticles

More particles that spawn from this particle over time. See SecondarySpawnInterval to control rate.

[JsonProperty]
public AdvancedParticleProperties[] SecondaryParticles { get; set; }

Property Value

AdvancedParticleProperties[]

SecondarySpawnInterval

The inverval that the SecondaryParticles spawn.

[JsonProperty]
public NatFloat SecondarySpawnInterval { get; set; }

Property Value

NatFloat

SelfPropelled

Whether or not the particle is self propelled.

[JsonProperty]
public bool SelfPropelled { get; set; }

Property Value

bool

Size

The size of the particles given.

[JsonProperty]
public NatFloat Size { get; set; }

Property Value

NatFloat

SizeEvolve

A transforming Size value.

[JsonProperty]
public EvolvingNatFloat SizeEvolve { get; set; }

Property Value

EvolvingNatFloat

SwimOnLiquid

Whether or not the particle floats on liquids.

[JsonProperty]
public bool SwimOnLiquid { get; set; }

Property Value

bool

TerrainCollision

Whether or not the particle collides with the terrain.

[JsonProperty]
public bool TerrainCollision { get; set; }

Property Value

bool

Velocity

The velocity of the particles.

[JsonProperty]
public NatFloat[] Velocity { get; set; }

Property Value

NatFloat[]

VelocityEvolve

A dynamic velocity value.

[JsonProperty]
public EvolvingNatFloat[] VelocityEvolve { get; set; }

Property Value

EvolvingNatFloat[]

VertexFlags

The level of glow in the particle.

[JsonProperty]
public int VertexFlags { get; set; }

Property Value

int

WindAffectednes

How much the particles are affected by wind.

[JsonProperty]
public float WindAffectednes { get; set; }

Property Value

float

WindAffectednesAtPos

public float WindAffectednesAtPos { get; set; }

Property Value

float

Methods

BeginParticle()

Begins the advanced particle.

public void BeginParticle()

Clone()

public AdvancedParticleProperties Clone()

Returns

AdvancedParticleProperties

FromBytes(BinaryReader, IWorldAccessor)

For reading from the network

public void FromBytes(BinaryReader reader, IWorldAccessor resolver)

Parameters

reader BinaryReader
resolver IWorldAccessor

GetRgbaColor(ICoreClientAPI)

Converts the color to RGBA.

public int GetRgbaColor(ICoreClientAPI capi)

Parameters

capi ICoreClientAPI

The Core Client API.

Returns

int

The set RGBA color.

GetVelocity(Vec3d)

Gets the velocity of the particle.

public Vec3f GetVelocity(Vec3d pos)

Parameters

pos Vec3d

Returns

Vec3f

Init(ICoreAPI)

Initializes the particle.

public void Init(ICoreAPI api)

Parameters

api ICoreAPI

The core API.

PrepareForSecondarySpawn(ParticleBase)

prepares the particle for secondary spawning.

public void PrepareForSecondarySpawn(ParticleBase particleInstance)

Parameters

particleInstance ParticleBase

ToBytes(BinaryWriter)

For sending over the network

public void ToBytes(BinaryWriter writer)

Parameters

writer BinaryWriter

createFromBytes(BinaryReader, IWorldAccessor)

public static AdvancedParticleProperties createFromBytes(BinaryReader reader, IWorldAccessor resolver)

Parameters

reader BinaryReader
resolver IWorldAccessor

Returns

AdvancedParticleProperties