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

◆ TryAllowingToCraftRecipe()

static bool Terraria.Main.TryAllowingToCraftRecipe ( Recipe currentRecipe,
bool tryFittingItemInInventoryToAllowCrafting,
out bool movedAnItemToAllowCrafting )
inlinestaticprivate

Definition at line 39367 of file Main.cs.

39368 {
39370 if (mouseItem.IsAir)
39371 {
39372 return true;
39373 }
39374 if (mouseItem.IsTheSameAs(currentRecipe.createItem) && mouseItem.stack + currentRecipe.createItem.stack <= mouseItem.maxStack)
39375 {
39376 return true;
39377 }
39378 if (tryFittingItemInInventoryToAllowCrafting && LocalPlayer.ItemSpace(mouseItem).CanTakeItemToPersonalInventory)
39379 {
39380 mouseItem = LocalPlayer.GetItem(myPlayer, mouseItem, GetItemSettings.InventoryUIToInventorySettingsShowAsNew);
39381 if (mouseItem.IsAir)
39382 {
39384 return true;
39385 }
39386 if (mouseItem.IsTheSameAs(currentRecipe.createItem) && mouseItem.stack + currentRecipe.createItem.stack <= mouseItem.maxStack)
39387 {
39389 return true;
39390 }
39391 }
39392 return false;
39393 }
static int myPlayer
Definition Main.cs:1801
static Item mouseItem
Definition Main.cs:1773
static Player LocalPlayer
Definition Main.cs:2829

References Terraria.Recipe.createItem, Terraria.GetItemSettings.InventoryUIToInventorySettingsShowAsNew, Terraria.Main.LocalPlayer, Terraria.Main.mouseItem, Terraria.Main.myPlayer, and Terraria.Item.stack.

Referenced by Terraria.Main.HoverOverCraftingItemButton().