Skip to content

OnExcavatorGather

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private object OnExcavatorGather( ExcavatorArm instance, Item item )
{
    Puts( "OnExcavatorGather works!" );
    return null;
}

Location

  • ExcavatorArm::ProduceResources()
csharp
//---
		int num3 = Mathf.FloorToInt(itemAmount.amount / (float)outputPiles.Count);
		itemAmount.amount -= num3 * 2;
		foreach (ExcavatorOutputPile outputPile in outputPiles)
		{
			Item item = ItemManager.Create(resourcesToMine[resourceMiningIndex].itemDef, num3, 0uL);
			if (Interface.CallHook("OnExcavatorGather", this, item) != null)
			{
				return;
			}
			Facepunch.Rust.Analytics.Azure.OnExcavatorProduceItem(item, this);
			if (!item.MoveToContainer(outputPile.inventory))
//---

Released under the MIT License.