OnFuelConsumed
OxideCarbonFuelCalled when a fuel is consumed.
void OnFuelConsumed(BaseOven baseOven, Item fuel, ItemModBurnable burnable)Works — the game method in this build is the one the hook was written for.
Parameters
- baseOven
- BaseOven
- fuel
- Item
- burnable
- ItemModBurnable
Return value
voidThe return value is ignored — the hook only notifies.
Example
private void OnFuelConsumed(BaseOven baseOven, Item fuel, ItemModBurnable burnable)
{
Puts("OnFuelConsumed");
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point
Rust.opj (Oxide)
void BaseOven.ConsumeFuel(Item, ItemModBurnable)
Passes: BaseOven baseOven, Item fuel, ItemModBurnable burnable
WorksReturnBehavior: ContinueArgumentBehavior: AllAssembly-CSharp.dll
Where it is called (this branch's game code)
// …
if (fuel.amount <= GetFuelRate())
{
fuel.Remove();
return;
}
int fuelRate = GetFuelRate();
fuel.fuel = burnable.fuelAmount;
fuel.UseItem(fuelRate);
Interface.CallHook("OnFuelConsumed", this, fuel, burnable);
Analytics.Azure.AddPendingItems(this, fuel.info.shortname, fuelRate, "smelt");
}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.