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

◆ GetItem_FillEmptyInventorySlot()

bool Terraria.Player.GetItem_FillEmptyInventorySlot ( int plr,
Item newItem,
GetItemSettings settings,
Item returnItem,
int i )
inlineprivate

Definition at line 38338 of file Player.cs.

38339 {
38340 //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
38341 //IL_00e5: Unknown result type (might be due to invalid IL or missing references)
38342 if (inventory[i].type != 0)
38343 {
38344 return false;
38345 }
38346 if (newItem.IsACoin)
38347 {
38348 SoundEngine.PlaySound(38, (int)position.X, (int)position.Y);
38349 }
38350 else
38351 {
38352 SoundEngine.PlaySound(7, (int)position.X, (int)position.Y);
38353 }
38354 returnItem.shimmered = false;
38355 inventory[i] = returnItem;
38356 if (!settings.NoText)
38357 {
38358 PopupText.NewText(PopupTextContext.RegularItemPickup, newItem, newItem.stack, noStack: false, settings.LongText);
38359 }
38360 DoCoins(i);
38361 if (plr == Main.myPlayer)
38362 {
38363 Recipe.FindRecipes();
38364 }
38366 if (plr == Main.myPlayer && newItem.type == 5095)
38367 {
38368 LucyAxeMessage.Create(LucyAxeMessage.MessageSource.PickedUp, base.Top, new Vector2(0f, -7f));
38369 }
38370 settings.HandlePostAction(inventory[i]);
38371 return true;
38372 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
static void NotifyItemPickup(Player player, Item item)
static void Create(MessageSource source, Vector2 position, Vector2 velocity)
void DoCoins(int i)
Definition Player.cs:38062
Item[] inventory
The player's normal inventory. Indexes 0-9 hold the hotbar items, 10-49 the rest of the main inventor...
Definition Player.cs:1767

References Terraria.GameContent.LucyAxeMessage.Create(), Terraria.Player.DoCoins(), Terraria.Recipe.FindRecipes(), Terraria.Player.inventory, Terraria.Main.myPlayer, Terraria.PopupText.NewText(), Terraria.GameContent.Achievements.AchievementsHelper.NotifyItemPickup(), Terraria.Audio.SoundEngine.PlaySound(), and Terraria.Entity.position.

Referenced by Terraria.Player.GetItem().

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