RustTip

OnExcavatorMiningToggled

OxideResource
void OnExcavatorMiningToggled(ExcavatorArm excavatorArm)
Works — the game method in this build is the one the hook was written for.

Parameters

excavatorArm
ExcavatorArm

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnExcavatorMiningToggled(ExcavatorArm excavatorArm)
{
    Puts("OnExcavatorMiningToggled");
}

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

Injection point 1

Rust.opj (Oxide)
void ExcavatorArm.BeginMining()

Passes: ExcavatorArm excavatorArm

WorksReturnBehavior: ContinueArgumentBehavior: JustThisAssembly-CSharp.dll

Injection point 2

Rust.opj (Oxide)
void ExcavatorArm.StopMining()

Passes: ExcavatorArm excavatorArm

WorksReturnBehavior: ContinueArgumentBehavior: JustThisAssembly-CSharp.dll

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

public void StopMining()
{
	ExcavatorServerEffects.SetMining(isMining: false);
	CancelInvoke(ProduceResources);
	SetFlagLocal(Flags.On, b: false);
	SendNetworkUpdate();
Interface.CallHook("OnExcavatorMiningToggled", this);
}

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.