TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ ServerPlaceItem()

static void Terraria.Chest.ServerPlaceItem ( int plr,
int slot )
inlinestatic

Attempts to move the item in plr 's inventory or Void Vault into nearby chests.
Only called on F:Terraria.ID.NetmodeID.Server.

Parameters
plrThe index of the T:Terraria.Player in F:Terraria.Main.player to try moving an item for.
slotThe T:Terraria.ID.PlayerItemSlotID to move an item from.
If slot < 58, then that slot of plr 's inventory is moved.
If slot >= F:Terraria.ID.PlayerItemSlotID.Bank4_0 && slot < F:Terraria.ID.PlayerItemSlotID.Bank4_0 + 40, then that slot (minus F:Terraria.ID.PlayerItemSlotID.Bank4_0) of plr 's Void Vault is moved.
Otherwise, no item is moved.

It's recommended to use M:Terraria.Player.QuickStackAllChests to handle this automatically.

Definition at line 368 of file Chest.cs.

369 {
370 //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
371 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
373 {
375 Main.player[plr].bank4.item[num] = PutItemInNearbyChest(Main.player[plr].bank4.item[num], Main.player[plr].Center);
376 NetMessage.SendData(5, -1, -1, null, plr, slot, Main.player[plr].bank4.item[num].prefix);
377 }
378 else if (slot < 58)
379 {
380 Main.player[plr].inventory[slot] = PutItemInNearbyChest(Main.player[plr].inventory[slot], Main.player[plr].Center);
381 NetMessage.SendData(5, -1, -1, null, plr, slot, Main.player[plr].inventory[slot].prefix);
382 }
383 }
static Item PutItemInNearbyChest(Item item, Vector2 position)
Attempts to move the given item into any chests near the given position. Cannot place items into a ch...
Definition Chest.cs:394

References Terraria.ID.PlayerItemSlotID.Bank4_0, Terraria.Main.player, Terraria.Chest.PutItemInNearbyChest(), and Terraria.NetMessage.SendData().

Referenced by Terraria.MessageBuffer.GetData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: