RustTip

OnFireworkStarted

OxideCarbonFirework

Called when a firework starts.

void OnFireworkStarted(BaseFirework baseFirework)
Works — the game method in this build is the one the hook was written for.

Parameters

baseFirework
BaseFirework

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnFireworkStarted(BaseFirework baseFirework)
{
    Puts("OnFireworkStarted");
}

Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.

Injection point

Rust.opj (Oxide)
void BaseFirework.Begin()

Passes: BaseFirework baseFirework

WorksReturnBehavior: ContinueArgumentBehavior: JustThisAssembly-CSharp.dll

Where it is called (this branch's game code)

public virtual void Begin()
{
	using (FlagsUpdateScope flagsUpdateScope = StartSetFlags(FlagsUpdateMode.SendNetworkUpdate_Flags))
	{
		flagsUpdateScope.Set(Flags.OnFire, b: false);
		flagsUpdateScope.Set(Flags.On, b: true);
	}
	Interface.CallHook("OnFireworkStarted", this);
	Invoke(OnExhausted, activityLength);
}

Sources: Rust.opj from OxideMod/Oxide.Rust (MIT) and hook metadata of the Carbon documentation (MIT). Method code is decompiled from this branch's server.