OnDroppedItemCombined
OxideCarbonItemCalled when a dropped item is combined.
void OnDroppedItemCombined(DroppedItem droppedItem)Works — the game method in this build is the one the hook was written for.
Parameters
- droppedItem
- DroppedItem
Return value
voidThe return value is ignored — the hook only notifies.
Example
private void OnDroppedItemCombined(DroppedItem droppedItem)
{
Puts("OnDroppedItemCombined");
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point
Rust.opj (Oxide)
void DroppedItem.OnDroppedOn(DroppedItem)
Passes: DroppedItem droppedItem
WorksReturnBehavior: ContinueArgumentBehavior: JustThisAssembly-CSharp.dll
Where it is called (this branch's game code)
public void OnDroppedOn(DroppedItem di)
{
if (item == null || NeverCombine || di.NeverCombine || !item.CanStack(di.item))
{
return;
}
Interface.CallHook("OnDroppedItemCombined", this);
int num = di.item.amount + item.amount;
if (num <= item.MaxStackable() && num != 0)
{
if (di.DropReason == DropReasonEnum.Player)
{
DropReason = DropReasonEnum.Player;
}
di.item.MigrateItemOwnership(item, di.item.amount);
// …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.