|
TModLoader v1.4.4.9
TModLoader source code documentation
|
|
inline |
Use to consume a single item. The item does not have to be F:Terraria.Item.consumable.
Attempts to reduce the F:Terraria.Item.stack of the first T:Terraria.Item found in the F:Terraria.Player.inventory by 1.
Respects M:Terraria.ModLoader.ItemLoader.ConsumeItem(Terraria.Item,Terraria.Player), so the item won't necessarily be consumed.
To consume multiple of the item, first check M:Terraria.Player.CountItem(System.Int32,System.Int32) to ensure that there are enough of the item, then use a for loop to call this method many times.
| type | The item type to consume |
| reverseOrder | If true, the search for the item will start at the end of the player inventory |
| includeVoidBag | If true, the void bag, if open, will also be considered for finding an item to consume |
Definition at line 7567 of file Player.cs.
References Terraria.Player.bank4, Terraria.ModLoader.ItemLoader.ConsumeItem(), Terraria.Player.FindItem(), Terraria.Player.inventory, Terraria.Chest.item, Terraria.Item.SetDefaults(), Terraria.Item.stack, Terraria.Item.TurnToAir(), and Terraria.Player.useVoidBag().
Referenced by Terraria.Wiring.MassWireOperation(), Terraria.Player.PayDD2CrystalsBeforeUse(), Terraria.Player.TileInteractionsUse(), and Terraria.UI.ItemSlot.TryOpenContainer().
Here is the call graph for this function:
Here is the caller graph for this function: