RustTip

OnResourceDepositCreated

OxideCarbonResource

Called when a resource deposit is created.

void OnResourceDepositCreated(ResourceDepositManager.ResourceDeposit local1)
Works — the game method in this build is the one the hook was written for.

Parameters

local1
ResourceDepositManager.ResourceDeposit

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnResourceDepositCreated(ResourceDepositManager.ResourceDeposit local1)
{
    Puts("OnResourceDepositCreated");
}

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

Injection point

Rust.opj (Oxide)
ResourceDepositManager.ResourceDeposit ResourceDepositManager.CreateFromPosition(Vector3)

Passes: ResourceDepositManager.ResourceDeposit local1

WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (l1)Assembly-CSharp.dll

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

// …
			}
			if (Random.Range(0f, 1f) >= 1f - num4)
			{
				resourceDeposit.Add(ItemManager.FindItemDefinition("hq.metal.ore"), 1f, Random.Range(5000, 10000), Random.Range(30f, 50f), ResourceDeposit.surveySpawnType.ITEM);
			}
		}
	}
	_deposits.Add(indexFrom, resourceDeposit);
	Interface.CallHook("OnResourceDepositCreated", resourceDeposit);
	Random.state = state;
	return resourceDeposit;
}

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.