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

◆ TryPlacing()

static void Terraria.GameContent.Tile_Entities.TEItemFrame.TryPlacing ( int x,
int y,
Item item,
int stack )
inlinestatic

Definition at line 130 of file TEItemFrame.cs.

131 {
132 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
133 WorldGen.RangeFrame(x, y, x + 2, y + 2);
134 int num = Find(x, y);
135 if (num == -1)
136 {
137 Item.NewItem((IEntitySource)new EntitySource_TileBreak(x, y), new Rectangle(x * 16, y * 16, 16, 16), item, noBroadcast: false, noGrabDelay: false, reverseLookup: false);
138 return;
139 }
141 if (tEItemFrame.item.stack > 0)
142 {
143 tEItemFrame.DropItem();
144 }
145 tEItemFrame.item = ItemLoader.TransferWithLimit(item, stack);
146 NetMessage.SendData(86, -1, -1, null, tEItemFrame.ID, x, y);
147 }
static Dictionary< int, TileEntity > ByID
Definition TileEntity.cs:20
static Item TransferWithLimit(Item source, int limit)
Extract up to limit items from source . If some items remain, M:Terraria.ModLoader....
This serves as the central class from which item-related functions are carried out....
Definition ItemLoader.cs:26
This object encapsulates context information about the source of a particular spawning event of an It...

References Terraria.GameContent.Tile_Entities.TEItemFrame.TEItemFrame(), Terraria.DataStructures.TileEntity.ByID, Terraria.GameContent.Tile_Entities.TEItemFrame.Find(), Terraria.GameContent.Tile_Entities.TEItemFrame.item, Terraria.Item.NewItem(), Terraria.WorldGen.RangeFrame(), Terraria.NetMessage.SendData(), and Terraria.ModLoader.ItemLoader.TransferWithLimit().

Referenced by Terraria.MessageBuffer.GetData(), and Terraria.GameContent.Tile_Entities.TEItemFrame.PlaceItemInFrame().

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