tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader.ItemLoader Class Reference

This serves as the central class from which item-related functions are carried out. It also stores a list of mod items by ID. More...

+ Collaboration diagram for Terraria.ModLoader.ItemLoader:

Classes

class  HookList
 

Static Public Member Functions

static bool AllowPrefix (Item item, int pre)
 
static bool AltFunctionUse (Item item, Player player)
 Calls ModItem.AltFunctionUse, then all GlobalItem.AltFunctionUse hooks, until one of them returns true. Returns whether any of the hooks returned true. More...
 
static string AnglerChat (int type)
 
static void ArmorArmGlowMask (int slot, Player drawPlayer, float shadow, ref int glowMask, ref Color color)
 Calls the item's body equipment texture's ArmorArmGlowMask hook, then all GlobalItem.ArmorArmGlowMask hooks. More...
 
static void ArmorSetShadows (Player player)
 If the player's head texture's IsVanitySet returns true, calls the equipment texture's ArmorSetShadows. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.ArmorSetShadows, using player.head, player.body, and player.legs. More...
 
static void AutoLightSelect (Item item, ref bool dryTorch, ref bool wetTorch, ref bool glowstick)
 
static bool CanBurnInLava (Item item)
 Calls ModItem.CanBurnInLava. More...
 
static bool CanEquipAccessory (Item item, int slot)
 
static ? bool CanHitNPC (Item item, Player player, NPC target)
 Gathers the results of ModItem.CanHitNPC and all GlobalItem.CanHitNPC hooks. If any of them returns false, this returns false. Otherwise, if any of them returns true then this returns true. If all of them return null, this returns null. More...
 
static bool CanHitPvp (Item item, Player player, Player target)
 Calls all GlobalItem.CanHitPvp hooks, then ModItem.CanHitPvp, until one of them returns false. If all of them return true, this returns true. More...
 
static bool CanPickup (Item item, Player player)
 
static bool CanRightClick (Item item)
 Calls ModItem.CanRightClick, then all GlobalItem.CanRightClick hooks, until one of the returns true. If one of the returns true, returns Main.mouseRight. Otherwise, returns false. More...
 
static bool CanUseItem (Item item, Player player)
 Returns the "and" operation on the results of ModItem.CanUseItem and all GlobalItem.CanUseItem hooks. Does not fail fast (every hook is called). More...
 
static void CaughtFishStack (Item item)
 
static bool CheckProjOnSwing (Player player, Item item)
 If the item is a modded item, ModItem.checkProjOnSwing is true, and the player is not at the beginning of the item's use animation, sets canShoot to false. More...
 
static int ChoosePrefix (Item item, UnifiedRandom rand)
 
static bool ConsumeAmmo (Item item, Item ammo, Player player)
 Calls ModItem.ConsumeAmmo for the weapon, ModItem.ConsumeAmmo for the ammo, then each GlobalItem.ConsumeAmmo hook for the weapon and ammo, until one of them returns false. If all of them return true, returns true. More...
 
static bool ConsumeItem (Item item, Player player)
 If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to false. More...
 
static void DrawArmorColor (EquipType type, int slot, Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
 Calls the item's equipment texture's DrawArmorColor hook, then all GlobalItem.DrawArmorColor hooks. More...
 
static bool DrawBody (Player player)
 Calls the item's body equipment texture's DrawBody hook, then all GlobalItem.DrawBody hooks, until one of them returns false. Returns true if none of them return false. More...
 
static void DrawHair (Player player, ref bool drawHair, ref bool drawAltHair)
 Calls the item's head equipment texture's DrawHair hook, then all GlobalItem.DrawHair hooks. More...
 
static void DrawHands (Player player, ref bool drawHands, ref bool drawArms)
 Calls the item's body equipment texture's DrawHands hook, then all GlobalItem.DrawHands hooks. More...
 
static bool DrawHead (Player player)
 Calls the item's head equipment texture's DrawHead hook, then all GlobalItem.DrawHead hooks, until one of them returns false. Returns true if none of them return false. More...
 
static bool DrawLegs (Player player)
 Calls the item's leg equipment texture's DrawLegs hook, then the item's shoe equipment texture's DrawLegs hook, then all GlobalItem.DrawLegs hooks, until one of them returns false. Returns true if none of them return false. More...
 
static void ExtractinatorUse (ref int resultType, ref int resultStack, int extractType)
 
static ? Color GetAlpha (Item item, Color lightColor)
 Calls all GlobalItem.GetAlpha hooks then ModItem.GetAlpha, until one of them returns a color, and returns that color. Returns null if all of the hooks return null. More...
 
static void GetHealLife (Item item, Player player, bool quickHeal, ref int healValue)
 Calls ModItem.GetHealLife, then all GlobalItem.GetHealLife hooks. More...
 
static void GetHealMana (Item item, Player player, bool quickHeal, ref int healValue)
 Calls ModItem.GetHealMana, then all GlobalItem.GetHealMana hooks. More...
 
static ModItem GetItem (int type)
 Gets the ModItem instance corresponding to the specified type. Returns null if no modded item has the given type. More...
 
static void GetWeaponCrit (Item item, Player player, ref int crit)
 Calls ModItem.GetWeaponCrit, then all GlobalItem.GetWeaponCrit hooks. More...
 
static void GetWeaponDamage (Item item, Player player, ref int damage)
 Calls ModItem.GetWeaponDamage, then all GlobalItem.GetWeaponDamage hooks. More...
 
static void GetWeaponKnockback (Item item, Player player, ref float knockback)
 Calls ModItem.GetWeaponKnockback, then all GlobalItem.GetWeaponKnockback hooks. More...
 
static Item GetWing (Player player)
 s Returns the wing item that the player is functionally using. If player.wingsLogic has been modified, so no equipped wing can be found to match what the player is using, this creates a new Item object to return. More...
 
static void GrabRange (Item item, Player player, ref int grabRange)
 Calls ModItem.GrabRange, then all GlobalItem.GrabRange hooks. More...
 
static bool GrabStyle (Item item, Player player)
 Calls all GlobalItem.GrabStyle hooks then ModItem.GrabStyle, until one of them returns true. Returns whether any of the hooks returned true. More...
 
static void HoldItem (Item item, Player player)
 Calls ModItem.HoldItem and all GlobalItem.HoldItem hooks. More...
 
static bool HoldItemFrame (Item item, Player player)
 Calls ModItem.HoldItemFrame, then all GlobalItem.HoldItemFrame hooks, until one of them returns true. Returns whether any of the hooks returned true. More...
 
static void HoldoutOffset (float gravDir, int type, ref Vector2 offset)
 
static void HoldoutOrigin (Player player, ref Vector2 origin)
 
static void HoldStyle (Item item, Player player)
 If the player is not holding onto a rope and is not in the middle of using an item, calls ModItem.HoldStyle and all GlobalItem.HoldStyle hooks. More...
 
static void HorizontalWingSpeeds (Player player)
 If the player is using wings, this uses the result of GetWing, and calls ModItem.HorizontalWingSpeeds then all GlobalItem.HorizontalWingSpeeds hooks. More...
 
static void IsAnglerQuestAvailable (int itemID, ref bool notAvailable)
 
static bool IsModBossBag (Item item)
 Returns whether ModItem.bossBagNPC is greater than 0. Returns false if item is not a modded item. More...
 
static bool ItemSpace (Item item, Player player)
 
static void MeleeEffects (Item item, Player player, Rectangle hitbox)
 Calls ModItem.MeleeEffects and all GlobalItem.MeleeEffects hooks. More...
 
static float MeleeSpeedMultiplier (Item item, Player player)
 
static void ModifyHitNPC (Item item, Player player, NPC target, ref int damage, ref float knockBack, ref bool crit)
 Calls ModItem.ModifyHitNPC, then all GlobalItem.ModifyHitNPC hooks. More...
 
static void ModifyHitPvp (Item item, Player player, Player target, ref int damage, ref bool crit)
 Calls ModItem.ModifyHitPvp, then all GlobalItem.ModifyHitPvp hooks. More...
 
static void ModifyManaCost (Item item, Player player, ref float reduce, ref float mult)
 Calls ModItem.ModifyManaCost, then all GlobalItem.ModifyManaCost hooks. More...
 
static List< TooltipLineModifyTooltips (Item item, ref int numTooltips, string[] names, ref string[] text, ref bool[] modifier, ref bool[] badModifier, ref int oneDropLogo, out Color?[] overrideColor)
 
static void ModifyWeaponDamage (Item item, Player player, ref float add, ref float mult, ref float flat)
 Calls ModItem.HookModifyWeaponDamage, then all GlobalItem.HookModifyWeaponDamage hooks. More...
 
static bool NeedsModSaving (Item item)
 
static void OnConsumeAmmo (Item item, Item ammo, Player player)
 Calls ModItem.OnConsumeAmmo for the weapon, ModItem.OnConsumeAmmo for the ammo, then each GlobalItem.OnConsumeAmmo hook for the weapon and ammo. More...
 
static void OnConsumeItem (Item item, Player player)
 Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks. More...
 
static void OnConsumeMana (Item item, Player player, int manaConsumed)
 Calls ModItem.OnConsumeMana, then all GlobalItem.OnConsumeMana hooks. More...
 
static void OnCraft (Item item, Recipe recipe)
 
static void OnHitNPC (Item item, Player player, NPC target, int damage, float knockBack, bool crit)
 Calls ModItem.OnHitNPC and all GlobalItem.OnHitNPC hooks. More...
 
static void OnHitPvp (Item item, Player player, Player target, int damage, bool crit)
 Calls ModItem.OnHitPvp and all GlobalItem.OnHitPvp hooks. More...
 
static void OnMissingMana (Item item, Player player, int neededMana)
 Calls ModItem.OnMissingMana, then all GlobalItem.OnMissingMana hooks. More...
 
static bool OnPickup (Item item, Player player)
 Calls all GlobalItem.OnPickup hooks then ModItem.OnPickup, until one of the returns false. Returns true if all of the hooks return true. More...
 
static void OpenBossBag (int type, Player player, ref int npc)
 If the item is a modded item and ModItem.bossBagNPC is greater than 0, calls ModItem.OpenBossBag and sets npc to ModItem.bossBagNPC. More...
 
static void OpenVanillaBag (string context, Player player, int arg)
 Calls all GlobalItem.OpenVanillaBag hooks. More...
 
static void PickAmmo (Item weapon, Item ammo, Player player, ref int type, ref float speed, ref int damage, ref float knockback)
 Calls ModItem.PickAmmo, then all GlobalItem.PickAmmo hooks. More...
 
static void PostDrawInInventory (Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
 Calls ModItem.PostDrawInInventory, then all GlobalItem.PostDrawInInventory hooks. More...
 
static void PostDrawInWorld (Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
 Calls ModItem.PostDrawInWorld, then all GlobalItem.PostDrawInWorld hooks. More...
 
static void PostDrawTooltip (Item item, ReadOnlyCollection< DrawableTooltipLine > lines)
 
static void PostDrawTooltipLine (Item item, DrawableTooltipLine line)
 
static void PostReforge (Item item)
 Calls ModItem.PostReforge, then all GlobalItem.PostReforge hooks. More...
 
static void PostUpdate (Item item)
 Calls ModItem.PostUpdate and all GlobalItem.PostUpdate hooks. More...
 
static bool PreDrawInInventory (Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
 Returns the "and" operator on the results of all GlobalItem.PreDrawInInventory hooks and ModItem.PreDrawInInventory. More...
 
static bool PreDrawInWorld (Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
 Returns the "and" operator on the results of ModItem.PreDrawInWorld and all GlobalItem.PreDrawInWorld hooks. More...
 
static bool PreDrawTooltip (Item item, ReadOnlyCollection< TooltipLine > lines, ref int x, ref int y)
 
static bool PreDrawTooltipLine (Item item, DrawableTooltipLine line, ref int yOffset)
 
static ? bool PrefixChance (Item item, int pre, UnifiedRandom rand)
 Allows for blocking, forcing and altering chance of prefix rolling. False (block) takes precedence over True (force). Null gives vanilla behaviour More...
 
static bool PreOpenVanillaBag (string context, Player player, int arg)
 Calls each GlobalItem.PreOpenVanillaBag hook until one of them returns false. Returns true if all of them returned true. More...
 
static bool PreReforge (Item item)
 Calls ModItem.PreReforge, then all GlobalItem.PreReforge hooks. More...
 
static void PreUpdateVanitySet (Player player)
 If the player's head texture's IsVanitySet returns true, calls the equipment texture's PreUpdateVanitySet. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.PreUpdateVanitySet, using player.head, player.body, and player.legs. More...
 
static bool ReforgePrice (Item item, ref int reforgePrice, ref bool canApplyDiscount)
 Call all ModItem.ReforgePrice, then GlobalItem.ReforgePrice hooks. More...
 
static void RightClick (Item item, Player player)
 If Main.mouseRightRelease is true, the following steps are taken: More...
 
static void SetMatch (int armorSlot, int type, bool male, ref int equipSlot, ref bool robes)
 Calls EquipTexture.SetMatch, then all GlobalItem.SetMatch hooks. More...
 
static bool Shoot (Item item, Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 Calls each GlobalItem.Shoot hook, then ModItem.Shoot, until one of them returns false. If all of them return true, returns true. More...
 
static void Update (Item item, ref float gravity, ref float maxFallSpeed)
 Calls ModItem.Update, then all GlobalItem.Update hooks. More...
 
static void UpdateAccessory (Item item, Player player, bool hideVisual)
 Calls ModItem.UpdateAccessory and all GlobalItem.UpdateAccessory hooks. More...
 
static void UpdateArmorSet (Player player, Item head, Item body, Item legs)
 If the head's ModItem.IsArmorSet returns true, calls the head's ModItem.UpdateArmorSet. This is then repeated for the body, then the legs. Then for each GlobalItem, if GlobalItem.IsArmorSet returns a non-empty string, calls GlobalItem.UpdateArmorSet with that string. More...
 
static void UpdateEquip (Item item, Player player)
 Calls ModItem.UpdateEquip and all GlobalItem.UpdateEquip hooks. More...
 
static void UpdateInventory (Item item, Player player)
 Calls ModItem.UpdateInventory and all GlobalItem.UpdateInventory hooks. More...
 
static void UpdateVanity (Player player)
 Calls each of the item's equipment texture's UpdateVanity hook. More...
 
static void UpdateVanitySet (Player player)
 If the player's head texture's IsVanitySet returns true, calls the equipment texture's UpdateVanitySet. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.UpdateVanitySet, using player.head, player.body, and player.legs. More...
 
static bool UseItem (Item item, Player player)
 Returns true if any of ModItem.UseItem or GlobalItem.UseItem return true Does not fail fast (calls every hook) More...
 
static bool UseItemFrame (Item item, Player player)
 Calls ModItem.UseItemFrame, then all GlobalItem.UseItemFrame hooks, until one of them returns true. Returns whether any of the hooks returned true. More...
 
static void UseItemHitbox (Item item, Player player, ref Rectangle hitbox, ref bool noHitbox)
 Calls ModItem.UseItemHitbox, then all GlobalItem.UseItemHitbox hooks. More...
 
static void UseStyle (Item item, Player player)
 Calls ModItem.UseStyle and all GlobalItem.UseStyle hooks. More...
 
static float UseTimeMultiplier (Item item, Player player)
 
static void VerticalWingSpeeds (Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
 If the player is using wings, this uses the result of GetWing, and calls ModItem.VerticalWingSpeeds then all GlobalItem.VerticalWingSpeeds hooks. More...
 
static bool WingUpdate (Player player, bool inUse)
 If wings can be seen on the player, calls the player's wing's equipment texture's WingUpdate and all GlobalItem.WingUpdate hooks. More...
 

Properties

static int ItemCount [get]
 

Private Member Functions

delegate void DelegateAnglerChat (int type, ref string chat, ref string catchLocation)
 
delegate void DelegateArmorArmGlowMask (int slot, Player drawPlayer, float shadow, ref int glowMask, ref Color color)
 
delegate void DelegateCaughtFishStack (int type, ref int stack)
 
delegate void DelegateDrawArmorColor (EquipType type, int slot, Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
 
delegate void DelegateDrawHair (int body, ref bool drawHair, ref bool drawAltHair)
 
delegate void DelegateDrawHands (int body, ref bool drawHands, ref bool drawArms)
 
delegate void DelegateExtractinatorUse (int extractType, ref int resultType, ref int resultStack)
 
delegate void DelegateGetHealLife (Item item, Player player, bool quickHeal, ref int healValue)
 
delegate void DelegateGetHealMana (Item item, Player player, bool quickHeal, ref int healValue)
 
delegate void DelegateGetWeaponCrit (Item item, Player player, ref int crit)
 
delegate void DelegateGetWeaponDamage (Item item, Player player, ref int damage)
 
delegate void DelegateGetWeaponKnockback (Item item, Player player, ref float knockback)
 
delegate void DelegateGrabRange (Item item, Player player, ref int grabRange)
 
delegate void DelegateHorizontalWingSpeeds (Item item, Player player, ref float speed, ref float acceleration)
 
delegate void DelegateModifyHitNPC (Item item, Player player, NPC target, ref int damage, ref float knockBack, ref bool crit)
 
delegate void DelegateModifyHitPvp (Item item, Player player, Player target, ref int damage, ref bool crit)
 
delegate void DelegateModifyManaCost (Item item, Player player, ref float reduce, ref float mult)
 
delegate void DelegateModifyWeaponDamage (Item item, Player player, ref float add, ref float mult, ref float flat)
 
delegate void DelegateModifyWeaponDamageOld (Item item, Player player, ref float add, ref float mult)
 
delegate void DelegateOldPickAmmo (Item item, Player player, ref int type, ref float speed, ref int damage, ref float knockback)
 
delegate void DelegatePickAmmo (Item weapon, Item ammo, Player player, ref int type, ref float speed, ref int damage, ref float knockback)
 
delegate void DelegatePostDrawTooltip (Item item, ReadOnlyCollection< DrawableTooltipLine > lines)
 
delegate void DelegatePostDrawTooltipLine (Item item, DrawableTooltipLine line)
 
delegate bool DelegatePreDrawInWorld (Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
 
delegate bool DelegatePreDrawTooltip (Item item, ReadOnlyCollection< TooltipLine > lines, ref int x, ref int y)
 
delegate bool DelegatePreDrawTooltipLine (Item item, DrawableTooltipLine line, ref int yOffset)
 
delegate bool DelegateReforgePrice (Item item, ref int reforgePrice, ref bool canApplyDiscount)
 
delegate void DelegateSetMatch (int armorSlot, int type, bool male, ref int equipSlot, ref bool robes)
 
delegate bool DelegateShoot (Item item, Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 
delegate void DelegateUpdate (Item item, ref float gravity, ref float maxFallSpeed)
 
delegate void DelegateUseItemHitbox (Item item, Player player, ref Rectangle hitbox, ref bool noHitbox)
 
delegate void DelegateVerticalWingSpeeds (Item item, Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
 

Static Private Member Functions

static HookList AddHook< F > (Expression< Func< GlobalItem, F > > func)
 
static Rectangle AnimatedItemFrame (Item item)
 
static void FindVanillaWings ()
 
static bool GeneralPrefix (Item item)
 
static bool HasMethod (Type t, string method, params Type[] args)
 

Static Private Attributes

static HookList HookAllowPrefix = AddHook<Func<Item, int, bool>>(g => g.AllowPrefix)
 
static HookList HookAltFunctionUse = AddHook<Func<Item, Player, bool>>(g => g.AltFunctionUse)
 
static HookList HookAnglerChat = AddHook<DelegateAnglerChat>(g => g.AnglerChat)
 
static HookList HookArmorArmGlowMask = AddHook<DelegateArmorArmGlowMask>(g => g.ArmorArmGlowMask)
 
static HookList HookArmorSetShadows = AddHook<Action<Player, string>>(g => g.ArmorSetShadows)
 
static HookList HookCanBurnInLava = AddHook<Func<Item, bool>>(g => g.CanBurnInLava)
 
static HookList HookCanEquipAccessory = AddHook<Func<Item, Player, int, bool>>(g => g.CanEquipAccessory)
 
static HookList HookCanHitNPC = AddHook<Func<Item, Player, NPC, bool?>>(g => g.CanHitNPC)
 
static HookList HookCanHitPvp = AddHook<Func<Item, Player, Player, bool>>(g => g.CanHitPvp)
 
static HookList HookCanPickup = AddHook<Func<Item, Player, bool>>(g => g.CanPickup)
 
static HookList HookCanRightClick = AddHook<Func<Item, bool>>(g => g.CanRightClick)
 
static HookList HookCanUseItem = AddHook<Func<Item, Player, bool>>(g => g.CanUseItem)
 
static HookList HookCaughtFishStack = AddHook<DelegateCaughtFishStack>(g => g.CaughtFishStack)
 
static HookList HookChoosePrefix = AddHook<Func<Item, UnifiedRandom, int>>(g => g.ChoosePrefix)
 
static HookList HookConsumeAmmo = AddHook<Func<Item, Player, bool>>(g => g.ConsumeAmmo)
 
static HookList HookConsumeItem = AddHook<Func<Item, Player, bool>>(g => g.ConsumeItem)
 
static HookList HookDrawArmorColor = AddHook<DelegateDrawArmorColor>(g => g.DrawArmorColor)
 
static HookList HookDrawBody = AddHook<Func<int, bool>>(g => g.DrawBody)
 
static HookList HookDrawHair = AddHook<DelegateDrawHair>(g => g.DrawHair)
 
static HookList HookDrawHands = AddHook<DelegateDrawHands>(g => g.DrawHands)
 
static HookList HookDrawHead = AddHook<Func<int, bool>>(g => g.DrawHead)
 
static HookList HookDrawLegs = AddHook<Func<int, int, bool>>(g => g.DrawLegs)
 
static HookList HookExtractinatorUse = AddHook<DelegateExtractinatorUse>(g => g.ExtractinatorUse)
 
static HookList HookGetAlpha = AddHook<Func<Item, Color, Color?>>(g => g.GetAlpha)
 
static HookList HookGetHealLife = AddHook<DelegateGetHealLife>(g => g.GetHealLife)
 
static HookList HookGetHealMana = AddHook<DelegateGetHealMana>(g => g.GetHealMana)
 
static HookList HookGetWeaponCrit = AddHook<DelegateGetWeaponCrit>(g => g.GetWeaponCrit)
 
static HookList HookGetWeaponDamage = AddHook<DelegateGetWeaponDamage>(g => g.GetWeaponDamage)
 
static HookList HookGetWeaponKnockback = AddHook<DelegateGetWeaponKnockback>(g => g.GetWeaponKnockback)
 
static HookList HookGrabRange = AddHook<DelegateGrabRange>(g => g.GrabRange)
 
static HookList HookGrabStyle = AddHook<Func<Item, Player, bool>>(g => g.GrabStyle)
 
static HookList HookHoldItem = AddHook<Action<Item, Player>>(g => g.HoldItem)
 
static HookList HookHoldItemFrame = AddHook<Func<Item, Player, bool>>(g => g.HoldItemFrame)
 
static HookList HookHoldoutOffset = AddHook<Func<int, Vector2?>>(g => g.HoldoutOffset)
 
static HookList HookHoldoutOrigin = AddHook<Func<int, Vector2?>>(g => g.HoldoutOrigin)
 
static HookList HookHoldStyle = AddHook<Action<Item, Player>>(g => g.HoldStyle)
 
static HookList HookHorizontalWingSpeeds = AddHook<DelegateHorizontalWingSpeeds>(g => g.HorizontalWingSpeeds)
 
static HookList HookIsAnglerQuestAvailable = AddHook<Func<int, bool>>(g => g.IsAnglerQuestAvailable)
 
static HookList HookItemSpace = AddHook<Func<Item, Player, bool>>(g => g.ItemSpace)
 
static HookList HookMeleeEffects = AddHook<Action<Item, Player, Rectangle>>(g => g.MeleeEffects)
 
static HookList HookMeleeSpeedMultiplier = AddHook<Func<Item, Player, float>>(g => g.MeleeSpeedMultiplier)
 
static HookList HookModifyHitNPC = AddHook<DelegateModifyHitNPC>(g => g.ModifyHitNPC)
 
static HookList HookModifyHitPvp = AddHook<DelegateModifyHitPvp>(g => g.ModifyHitPvp)
 
static HookList HookModifyManaCost = AddHook<DelegateModifyManaCost>(g => g.ModifyManaCost)
 
static HookList HookModifyTooltips = AddHook<Action<Item, List<TooltipLine>>>(g => g.ModifyTooltips)
 
static HookList HookModifyWeaponDamage = AddHook<DelegateModifyWeaponDamage>(g => g.ModifyWeaponDamage)
 
static HookList HookModifyWeaponDamageOld = AddHook<DelegateModifyWeaponDamage>(g => g.ModifyWeaponDamage)
 
static HookList HookNeedsSaving = AddHook<Func<Item, bool>>(g => g.NeedsSaving)
 
static HookList HookOldPickAmmo = AddHook<DelegateOldPickAmmo>(g => g.PickAmmo)
 
static HookList HookOnConsumeAmmo = AddHook<Action<Item, Player>>(g => g.OnConsumeAmmo)
 
static HookList HookOnConsumeItem = AddHook<Action<Item, Player>>(g => g.OnConsumeItem)
 
static HookList HookOnConsumeMana = AddHook<Action<Item, Player, int>>(g => g.OnConsumeMana)
 
static HookList HookOnCraft = AddHook<Action<Item, Recipe>>(g => g.OnCraft)
 
static HookList HookOnHitNPC = AddHook<Action<Item, Player, NPC, int, float, bool>>(g => g.OnHitNPC)
 
static HookList HookOnHitPvp = AddHook<Action<Item, Player, Player, int, bool>>(g => g.OnHitPvp)
 
static HookList HookOnMissingMana = AddHook<Action<Item, Player, int>>(g => g.OnMissingMana)
 
static HookList HookOnPickup = AddHook<Func<Item, Player, bool>>(g => g.OnPickup)
 
static HookList HookOpenVanillaBag = AddHook<Action<string, Player, int>>(g => g.OpenVanillaBag)
 
static HookList HookPickAmmo = AddHook<DelegatePickAmmo>(g => g.PickAmmo)
 
static HookList HookPostDrawInInventory = AddHook<Action<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float>>(g => g.PostDrawInInventory)
 
static HookList HookPostDrawInWorld = AddHook<Action<Item, SpriteBatch, Color, Color, float, float, int>>(g => g.PostDrawInWorld)
 
static HookList HookPostDrawTooltip = AddHook<DelegatePostDrawTooltip>(g => g.PostDrawTooltip)
 
static HookList HookPostDrawTooltipLine = AddHook<DelegatePostDrawTooltipLine>(g => g.PostDrawTooltipLine)
 
static HookList HookPostReforge = AddHook<Action<Item>>(g => g.PostReforge)
 
static HookList HookPostUpdate = AddHook<Action<Item>>(g => g.PostUpdate)
 
static HookList HookPreDrawInInventory = AddHook<Func<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float, bool>>(g => g.PreDrawInInventory)
 
static HookList HookPreDrawInWorld = AddHook<DelegatePreDrawInWorld>(g => g.PreDrawInWorld)
 
static HookList HookPreDrawTooltip = AddHook<DelegatePreDrawTooltip>(g => g.PreDrawTooltip)
 
static HookList HookPreDrawTooltipLine = AddHook<DelegatePreDrawTooltipLine>(g => g.PreDrawTooltipLine)
 
static HookList HookPrefixChance = AddHook<Func<Item, int, UnifiedRandom, bool?>>(g => g.PrefixChance)
 
static HookList HookPreOpenVanillaBag = AddHook<Func<string, Player, int, bool>>(g => g.PreOpenVanillaBag)
 
static HookList HookPreReforge = AddHook<Func<Item, bool>>(g => g.NewPreReforge)
 
static HookList HookPreUpdateVanitySet = AddHook<Action<Player, string>>(g => g.PreUpdateVanitySet)
 
static HookList HookReforgePrice = AddHook<DelegateReforgePrice>(g => g.ReforgePrice)
 
static HookList HookRightClick = AddHook<Action<Item, Player>>(g => g.RightClick)
 
static List< HookListhooks = new List<HookList>()
 
static HookList HookSetDefaults = AddHook<Action<Item>>(g => g.SetDefaults)
 
static HookList HookSetMatch = AddHook<DelegateSetMatch>(g => g.SetMatch)
 
static HookList HookShoot = AddHook<DelegateShoot>(g => g.Shoot)
 
static HookList HookUpdate = AddHook<DelegateUpdate>(g => g.Update)
 
static HookList HookUpdateAccessory = AddHook<Action<Item, Player, bool>>(g => g.UpdateAccessory)
 
static HookList HookUpdateArmorSet = AddHook<Action<Player, string>>(g => g.UpdateArmorSet)
 
static HookList HookUpdateEquip = AddHook<Action<Item, Player>>(g => g.UpdateEquip)
 
static HookList HookUpdateInventory = AddHook<Action<Item, Player>>(g => g.UpdateInventory)
 
static HookList HookUpdateVanitySet = AddHook<Action<Player, string>>(g => g.UpdateVanitySet)
 
static HookList HookUseItem = AddHook<Func<Item, Player, bool>>(g => g.UseItem)
 
static HookList HookUseItemFrame = AddHook<Func<Item, Player, bool>>(g => g.UseItemFrame)
 
static HookList HookUseItemHitbox = AddHook<DelegateUseItemHitbox>(g => g.UseItemHitbox)
 
static HookList HookUseStyle = AddHook<Action<Item, Player>>(g => g.UseStyle)
 
static HookList HookUseTimeMultiplier = AddHook<Func<Item, Player, float>>(g => g.UseTimeMultiplier)
 
static HookList HookVerticalWingSpeeds = AddHook<DelegateVerticalWingSpeeds>(g => g.VerticalWingSpeeds)
 
static HookList HookWingUpdate = AddHook<Func<int, Player, bool, bool>>(g => g.WingUpdate)
 
static int nextItem = ItemID.Count
 

Detailed Description

This serves as the central class from which item-related functions are carried out. It also stores a list of mod items by ID.

Definition at line 21 of file ItemLoader.cs.

Member Function Documentation

◆ AddHook< F >()

static HookList Terraria.ModLoader.ItemLoader.AddHook< F > ( Expression< Func< GlobalItem, F > >  func)
staticprivate

Definition at line 46 of file ItemLoader.cs.

46 {
47 var hook = new HookList(ModLoader.Method(func));
48 hooks.Add(hook);
49 return hook;
50 }
static List< HookList > hooks
Definition: ItemLoader.cs:44

References Terraria.ModLoader.ItemLoader.hooks.

◆ AllowPrefix()

static bool Terraria.ModLoader.ItemLoader.AllowPrefix ( Item  item,
int  pre 
)
static

Definition at line 289 of file ItemLoader.cs.

289 {
290 bool result = true;
291 foreach (var g in HookAllowPrefix.arr) {
292 result &= g.Instance(item).AllowPrefix(item, pre);
293 }
294 if (item.modItem != null) {
295 result &= item.modItem.AllowPrefix(pre);
296 }
297 return result;
298 }
static HookList HookAllowPrefix
Definition: ItemLoader.cs:288

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookAllowPrefix.

◆ AltFunctionUse()

static bool Terraria.ModLoader.ItemLoader.AltFunctionUse ( Item  item,
Player  player 
)
static

Calls ModItem.AltFunctionUse, then all GlobalItem.AltFunctionUse hooks, until one of them returns true. Returns whether any of the hooks returned true.

Definition at line 848 of file ItemLoader.cs.

848 {
849 if (item.IsAir)
850 return false;
851
852 if (item.modItem != null && item.modItem.AltFunctionUse(player))
853 return true;
854
855 foreach (var g in HookAltFunctionUse.arr)
856 if (g.Instance(item).AltFunctionUse(item, player))
857 return true;
858
859 return false;
860 }
static HookList HookAltFunctionUse
Definition: ItemLoader.cs:844

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookAltFunctionUse.

◆ AnglerChat()

static string Terraria.ModLoader.ItemLoader.AnglerChat ( int  type)
static

Definition at line 1660 of file ItemLoader.cs.

1660 {
1661 string chat = "";
1662 string catchLocation = "";
1663 GetItem(type)?.AnglerQuestChat(ref chat, ref catchLocation);
1664
1665 foreach (var g in HookAnglerChat.arr)
1666 g.AnglerChat(type, ref chat, ref catchLocation);
1667
1668 if (string.IsNullOrEmpty(chat) || string.IsNullOrEmpty(catchLocation))
1669 return null;
1670
1671 return chat + "\n\n(" + catchLocation + ")";
1672 }
static ModItem GetItem(int type)
Gets the ModItem instance corresponding to the specified type. Returns null if no modded item has the...
Definition: ItemLoader.cs:76
static HookList HookAnglerChat
Definition: ItemLoader.cs:1659
virtual void AnglerQuestChat(ref string description, ref string catchLocation)
Allows you to set what the Angler says when he requests for this item. The description parameter is h...
Definition: ModItem.cs:994

References Terraria.ModLoader.ModItem.AnglerQuestChat(), Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.ItemLoader.GetItem(), and Terraria.ModLoader.ItemLoader.HookAnglerChat.

+ Here is the call graph for this function:

◆ AnimatedItemFrame()

static Rectangle Terraria.ModLoader.ItemLoader.AnimatedItemFrame ( Item  item)
staticprivate

Definition at line 242 of file ItemLoader.cs.

242 {
243 int frameCount = Main.itemAnimations[item.type].FrameCount;
244 int frameDuration = Main.itemAnimations[item.type].TicksPerFrame;
245 return Main.itemAnimations[item.type].GetFrame(Main.itemTexture[item.type]);
246 }

◆ ArmorArmGlowMask()

static void Terraria.ModLoader.ItemLoader.ArmorArmGlowMask ( int  slot,
Player  drawPlayer,
float  shadow,
ref int  glowMask,
ref Color  color 
)
static

Calls the item's body equipment texture's ArmorArmGlowMask hook, then all GlobalItem.ArmorArmGlowMask hooks.

Definition at line 1276 of file ItemLoader.cs.

1276 {
1277 EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, slot);
1278 texture?.ArmorArmGlowMask(drawPlayer, shadow, ref glowMask, ref color);
1279
1280 foreach (var g in HookArmorArmGlowMask.arr)
1281 g.ArmorArmGlowMask(slot, drawPlayer, shadow, ref glowMask, ref color);
1282 }
static HookList HookArmorArmGlowMask
Definition: ItemLoader.cs:1272
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:7

References Terraria.ModLoader.EquipTexture.ArmorArmGlowMask(), Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), and Terraria.ModLoader.ItemLoader.HookArmorArmGlowMask.

+ Here is the call graph for this function:

◆ ArmorSetShadows()

static void Terraria.ModLoader.ItemLoader.ArmorSetShadows ( Player  player)
static

If the player's head texture's IsVanitySet returns true, calls the equipment texture's ArmorSetShadows. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.ArmorSetShadows, using player.head, player.body, and player.legs.

Definition at line 999 of file ItemLoader.cs.

999 {
1000 EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1001 EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1002 EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
1003 if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
1004 headTexture.ArmorSetShadows(player);
1005
1006 if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
1007 bodyTexture.ArmorSetShadows(player);
1008
1009 if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
1010 legTexture.ArmorSetShadows(player);
1011
1012 foreach (GlobalItem globalItem in HookArmorSetShadows.arr) {
1013 string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
1014 if (!string.IsNullOrEmpty(set))
1015 globalItem.ArmorSetShadows(player, set);
1016 }
1017 }
static HookList HookArmorSetShadows
Definition: ItemLoader.cs:993

References Terraria.ModLoader.EquipTexture.ArmorSetShadows(), Terraria.ModLoader.GlobalItem.ArmorSetShadows(), Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.ItemLoader.HookArmorSetShadows, Terraria.ModLoader.EquipTexture.IsVanitySet(), and Terraria.ModLoader.GlobalItem.IsVanitySet().

+ Here is the call graph for this function:

◆ AutoLightSelect()

static void Terraria.ModLoader.ItemLoader.AutoLightSelect ( Item  item,
ref bool  dryTorch,
ref bool  wetTorch,
ref bool  glowstick 
)
static

Definition at line 1626 of file ItemLoader.cs.

1626 {
1627 if (item.modItem != null) {
1628 item.modItem.AutoLightSelect(ref dryTorch, ref wetTorch, ref glowstick);
1629 if (wetTorch) {
1630 dryTorch = false;
1631 glowstick = false;
1632 }
1633 if (dryTorch) {
1634 glowstick = false;
1635 }
1636 }
1637 }

◆ CanBurnInLava()

static bool Terraria.ModLoader.ItemLoader.CanBurnInLava ( Item  item)
static

Calls ModItem.CanBurnInLava.

Definition at line 1392 of file ItemLoader.cs.

1393 {
1394 foreach (var g in HookCanBurnInLava.arr)
1395 if (g.Instance(item).CanBurnInLava(item))
1396 return true;
1397
1398 return item.modItem?.CanBurnInLava() ?? false;
1399 }
static HookList HookCanBurnInLava
Definition: ItemLoader.cs:1388

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookCanBurnInLava.

◆ CanEquipAccessory()

static bool Terraria.ModLoader.ItemLoader.CanEquipAccessory ( Item  item,
int  slot 
)
static

Definition at line 1605 of file ItemLoader.cs.

1605 {
1606 Player player = Main.player[Main.myPlayer];
1607 if (item.modItem != null && !item.modItem.CanEquipAccessory(player, slot))
1608 return false;
1609
1610 foreach (var g in HookCanEquipAccessory.arr)
1611 if (!g.Instance(item).CanEquipAccessory(item, player, slot))
1612 return false;
1613
1614 return true;
1615 }
static HookList HookCanEquipAccessory
Definition: ItemLoader.cs:1602

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookCanEquipAccessory.

◆ CanHitNPC()

static ? bool Terraria.ModLoader.ItemLoader.CanHitNPC ( Item  item,
Player  player,
NPC  target 
)
static

Gathers the results of ModItem.CanHitNPC and all GlobalItem.CanHitNPC hooks. If any of them returns false, this returns false. Otherwise, if any of them returns true then this returns true. If all of them return null, this returns null.

Definition at line 668 of file ItemLoader.cs.

668 {
669 bool? canHit = item.modItem?.CanHitNPC(player, target);
670 if (canHit.HasValue && !canHit.Value) {
671 return false;
672 }
673 foreach (var g in HookCanHitNPC.arr) {
674 bool? globalCanHit = g.Instance(item).CanHitNPC(item, player, target);
675 if (globalCanHit.HasValue) {
676 if (globalCanHit.Value) {
677 canHit = true;
678 }
679 else {
680 return false;
681 }
682 }
683 }
684 return canHit;
685 }
static HookList HookCanHitNPC
Definition: ItemLoader.cs:657

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookCanHitNPC.

◆ CanHitPvp()

static bool Terraria.ModLoader.ItemLoader.CanHitPvp ( Item  item,
Player  player,
Player  target 
)
static

Calls all GlobalItem.CanHitPvp hooks, then ModItem.CanHitPvp, until one of them returns false. If all of them return true, this returns true.

Definition at line 720 of file ItemLoader.cs.

720 {
721 foreach (var g in HookCanHitPvp.arr)
722 if (!g.Instance(item).CanHitPvp(item, player, target))
723 return false;
724
725 return item.modItem == null || item.modItem.CanHitPvp(player, target);
726 }
static HookList HookCanHitPvp
Definition: ItemLoader.cs:714

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookCanHitPvp.

◆ CanPickup()

static bool Terraria.ModLoader.ItemLoader.CanPickup ( Item  item,
Player  player 
)
static

Definition at line 1443 of file ItemLoader.cs.

1443 {
1444 foreach (var g in HookCanPickup.arr)
1445 if (!g.Instance(item).CanPickup(item, player))
1446 return false;
1447
1448 return item.modItem?.CanPickup(player) ?? true;
1449 }
static HookList HookCanPickup
Definition: ItemLoader.cs:1440

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookCanPickup.

◆ CanRightClick()

static bool Terraria.ModLoader.ItemLoader.CanRightClick ( Item  item)
static

Calls ModItem.CanRightClick, then all GlobalItem.CanRightClick hooks, until one of the returns true. If one of the returns true, returns Main.mouseRight. Otherwise, returns false.

Definition at line 1038 of file ItemLoader.cs.

1038 {
1039 if (item.IsAir || !Main.mouseRight)
1040 return false;
1041
1042 if (item.modItem != null && item.modItem.CanRightClick())
1043 return true;
1044
1045 foreach (var g in HookCanRightClick.arr)
1046 if (g.Instance(item).CanRightClick(item))
1047 return true;
1048
1049 return false;
1050 }
static HookList HookCanRightClick
Definition: ItemLoader.cs:1032

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookCanRightClick.

◆ CanUseItem()

static bool Terraria.ModLoader.ItemLoader.CanUseItem ( Item  item,
Player  player 
)
static

Returns the "and" operation on the results of ModItem.CanUseItem and all GlobalItem.CanUseItem hooks. Does not fail fast (every hook is called).

Parameters
itemThe item.
playerThe player holding the item.

Definition at line 310 of file ItemLoader.cs.

310 {
311 bool flag = true;
312 if (item.modItem != null)
313 flag &= item.modItem.CanUseItem(player);
314
315 foreach (var g in HookCanUseItem.arr)
316 flag &= g.Instance(item).CanUseItem(item, player);
317
318 return flag;
319 }
static HookList HookCanUseItem
Definition: ItemLoader.cs:300

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookCanUseItem.

◆ CaughtFishStack()

static void Terraria.ModLoader.ItemLoader.CaughtFishStack ( Item  item)
static

Definition at line 1641 of file ItemLoader.cs.

1641 {
1642 item.modItem?.CaughtFishStack(ref item.stack);
1643
1644 foreach (var g in HookCaughtFishStack.arr)
1645 g.Instance(item).CaughtFishStack(item.type, ref item.stack);
1646 }
static HookList HookCaughtFishStack
Definition: ItemLoader.cs:1640

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookCaughtFishStack.

◆ CheckProjOnSwing()

static bool Terraria.ModLoader.ItemLoader.CheckProjOnSwing ( Player  player,
Item  item 
)
static

If the item is a modded item, ModItem.checkProjOnSwing is true, and the player is not at the beginning of the item's use animation, sets canShoot to false.

Definition at line 539 of file ItemLoader.cs.

539 {
540 return item.modItem == null || !item.modItem.OnlyShootOnSwing || player.itemAnimation == player.itemAnimationMax - 1;
541 }

◆ ChoosePrefix()

static int Terraria.ModLoader.ItemLoader.ChoosePrefix ( Item  item,
UnifiedRandom  rand 
)
static

Definition at line 250 of file ItemLoader.cs.

250 {
251 foreach (var g in HookChoosePrefix.arr) {
252 int pre = g.Instance(item).ChoosePrefix(item, rand);
253 if (pre > 0) {
254 return pre;
255 }
256 }
257 if (item.modItem != null) {
258 int pre = item.modItem.ChoosePrefix(rand);
259 if (pre > 0) {
260 return pre;
261 }
262 }
263 return -1;
264 }
static HookList HookChoosePrefix
Definition: ItemLoader.cs:248

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookChoosePrefix.

◆ ConsumeAmmo()

static bool Terraria.ModLoader.ItemLoader.ConsumeAmmo ( Item  item,
Item  ammo,
Player  player 
)
static

Calls ModItem.ConsumeAmmo for the weapon, ModItem.ConsumeAmmo for the ammo, then each GlobalItem.ConsumeAmmo hook for the weapon and ammo, until one of them returns false. If all of them return true, returns true.

Definition at line 569 of file ItemLoader.cs.

569 {
570 if (item.modItem != null && !item.modItem.ConsumeAmmo(player) ||
571 ammo.modItem != null && !ammo.modItem.ConsumeAmmo(player))
572 return false;
573
574 foreach (var g in HookConsumeAmmo.arr) {
575 if (!g.Instance(item).ConsumeAmmo(item, player) ||
576 !g.Instance(ammo).ConsumeAmmo(ammo, player))
577 return false;
578 }
579
580 return true;
581 }
static HookList HookConsumeAmmo
Definition: ItemLoader.cs:563

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookConsumeAmmo.

◆ ConsumeItem()

static bool Terraria.ModLoader.ItemLoader.ConsumeItem ( Item  item,
Player  player 
)
static

If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to false.

Definition at line 780 of file ItemLoader.cs.

780 {
781 if (item.IsAir) return true;
782 if (item.modItem != null && !item.modItem.ConsumeItem(player))
783 return false;
784
785 foreach (var g in HookConsumeItem.arr)
786 if (!g.Instance(item).ConsumeItem(item, player))
787 return false;
788
789 OnConsumeItem(item, player);
790 return true;
791 }
static HookList HookConsumeItem
Definition: ItemLoader.cs:774
static void OnConsumeItem(Item item, Player player)
Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.
Definition: ItemLoader.cs:797

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.ItemLoader.HookConsumeItem, and Terraria.ModLoader.ItemLoader.OnConsumeItem().

Referenced by Terraria.ModLoader.ItemLoader.RightClick().

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

◆ DelegateAnglerChat()

delegate void Terraria.ModLoader.ItemLoader.DelegateAnglerChat ( int  type,
ref string  chat,
ref string  catchLocation 
)
private

◆ DelegateArmorArmGlowMask()

delegate void Terraria.ModLoader.ItemLoader.DelegateArmorArmGlowMask ( int  slot,
Player  drawPlayer,
float  shadow,
ref int  glowMask,
ref Color  color 
)
private

◆ DelegateCaughtFishStack()

delegate void Terraria.ModLoader.ItemLoader.DelegateCaughtFishStack ( int  type,
ref int  stack 
)
private

◆ DelegateDrawArmorColor()

delegate void Terraria.ModLoader.ItemLoader.DelegateDrawArmorColor ( EquipType  type,
int  slot,
Player  drawPlayer,
float  shadow,
ref Color  color,
ref int  glowMask,
ref Color  glowMaskColor 
)
private

◆ DelegateDrawHair()

delegate void Terraria.ModLoader.ItemLoader.DelegateDrawHair ( int  body,
ref bool  drawHair,
ref bool  drawAltHair 
)
private

◆ DelegateDrawHands()

delegate void Terraria.ModLoader.ItemLoader.DelegateDrawHands ( int  body,
ref bool  drawHands,
ref bool  drawArms 
)
private

◆ DelegateExtractinatorUse()

delegate void Terraria.ModLoader.ItemLoader.DelegateExtractinatorUse ( int  extractType,
ref int  resultType,
ref int  resultStack 
)
private

◆ DelegateGetHealLife()

delegate void Terraria.ModLoader.ItemLoader.DelegateGetHealLife ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
private

◆ DelegateGetHealMana()

delegate void Terraria.ModLoader.ItemLoader.DelegateGetHealMana ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
private

◆ DelegateGetWeaponCrit()

delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponCrit ( Item  item,
Player  player,
ref int  crit 
)
private

◆ DelegateGetWeaponDamage()

delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponDamage ( Item  item,
Player  player,
ref int  damage 
)
private

◆ DelegateGetWeaponKnockback()

delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponKnockback ( Item  item,
Player  player,
ref float  knockback 
)
private

◆ DelegateGrabRange()

delegate void Terraria.ModLoader.ItemLoader.DelegateGrabRange ( Item  item,
Player  player,
ref int  grabRange 
)
private

◆ DelegateHorizontalWingSpeeds()

delegate void Terraria.ModLoader.ItemLoader.DelegateHorizontalWingSpeeds ( Item  item,
Player  player,
ref float  speed,
ref float  acceleration 
)
private

◆ DelegateModifyHitNPC()

delegate void Terraria.ModLoader.ItemLoader.DelegateModifyHitNPC ( Item  item,
Player  player,
NPC  target,
ref int  damage,
ref float  knockBack,
ref bool  crit 
)
private

◆ DelegateModifyHitPvp()

delegate void Terraria.ModLoader.ItemLoader.DelegateModifyHitPvp ( Item  item,
Player  player,
Player  target,
ref int  damage,
ref bool  crit 
)
private

◆ DelegateModifyManaCost()

delegate void Terraria.ModLoader.ItemLoader.DelegateModifyManaCost ( Item  item,
Player  player,
ref float  reduce,
ref float  mult 
)
private

◆ DelegateModifyWeaponDamage()

delegate void Terraria.ModLoader.ItemLoader.DelegateModifyWeaponDamage ( Item  item,
Player  player,
ref float  add,
ref float  mult,
ref float  flat 
)
private

◆ DelegateModifyWeaponDamageOld()

delegate void Terraria.ModLoader.ItemLoader.DelegateModifyWeaponDamageOld ( Item  item,
Player  player,
ref float  add,
ref float  mult 
)
private

◆ DelegateOldPickAmmo()

delegate void Terraria.ModLoader.ItemLoader.DelegateOldPickAmmo ( Item  item,
Player  player,
ref int  type,
ref float  speed,
ref int  damage,
ref float  knockback 
)
private

◆ DelegatePickAmmo()

delegate void Terraria.ModLoader.ItemLoader.DelegatePickAmmo ( Item  weapon,
Item  ammo,
Player  player,
ref int  type,
ref float  speed,
ref int  damage,
ref float  knockback 
)
private

◆ DelegatePostDrawTooltip()

delegate void Terraria.ModLoader.ItemLoader.DelegatePostDrawTooltip ( Item  item,
ReadOnlyCollection< DrawableTooltipLine lines 
)
private

◆ DelegatePostDrawTooltipLine()

delegate void Terraria.ModLoader.ItemLoader.DelegatePostDrawTooltipLine ( Item  item,
DrawableTooltipLine  line 
)
private

◆ DelegatePreDrawInWorld()

delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawInWorld ( Item  item,
SpriteBatch  spriteBatch,
Color  lightColor,
Color  alphaColor,
ref float  rotation,
ref float  scale,
int  whoAmI 
)
private

◆ DelegatePreDrawTooltip()

delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawTooltip ( Item  item,
ReadOnlyCollection< TooltipLine lines,
ref int  x,
ref int  y 
)
private

◆ DelegatePreDrawTooltipLine()

delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawTooltipLine ( Item  item,
DrawableTooltipLine  line,
ref int  yOffset 
)
private

◆ DelegateReforgePrice()

delegate bool Terraria.ModLoader.ItemLoader.DelegateReforgePrice ( Item  item,
ref int  reforgePrice,
ref bool  canApplyDiscount 
)
private

◆ DelegateSetMatch()

delegate void Terraria.ModLoader.ItemLoader.DelegateSetMatch ( int  armorSlot,
int  type,
bool  male,
ref int  equipSlot,
ref bool  robes 
)
private

◆ DelegateShoot()

delegate bool Terraria.ModLoader.ItemLoader.DelegateShoot ( Item  item,
Player  player,
ref Vector2  position,
ref float  speedX,
ref float  speedY,
ref int  type,
ref int  damage,
ref float  knockBack 
)
private

◆ DelegateUpdate()

delegate void Terraria.ModLoader.ItemLoader.DelegateUpdate ( Item  item,
ref float  gravity,
ref float  maxFallSpeed 
)
private

◆ DelegateUseItemHitbox()

delegate void Terraria.ModLoader.ItemLoader.DelegateUseItemHitbox ( Item  item,
Player  player,
ref Rectangle  hitbox,
ref bool  noHitbox 
)
private

◆ DelegateVerticalWingSpeeds()

delegate void Terraria.ModLoader.ItemLoader.DelegateVerticalWingSpeeds ( Item  item,
Player  player,
ref float  ascentWhenFalling,
ref float  ascentWhenRising,
ref float  maxCanAscendMultiplier,
ref float  maxAscentMultiplier,
ref float  constantAscend 
)
private

◆ DrawArmorColor()

static void Terraria.ModLoader.ItemLoader.DrawArmorColor ( EquipType  type,
int  slot,
Player  drawPlayer,
float  shadow,
ref Color  color,
ref int  glowMask,
ref Color  glowMaskColor 
)
static

Calls the item's equipment texture's DrawArmorColor hook, then all GlobalItem.DrawArmorColor hooks.

Definition at line 1262 of file ItemLoader.cs.

1263 {
1264 EquipTexture texture = EquipLoader.GetEquipTexture(type, slot);
1265 texture?.DrawArmorColor(drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
1266
1267 foreach (var g in HookDrawArmorColor.arr)
1268 g.DrawArmorColor(type, slot, drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
1269 }
static HookList HookDrawArmorColor
Definition: ItemLoader.cs:1258

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawArmorColor(), Terraria.ModLoader.EquipLoader.GetEquipTexture(), and Terraria.ModLoader.ItemLoader.HookDrawArmorColor.

+ Here is the call graph for this function:

◆ DrawBody()

static bool Terraria.ModLoader.ItemLoader.DrawBody ( Player  player)
static

Calls the item's body equipment texture's DrawBody hook, then all GlobalItem.DrawBody hooks, until one of them returns false. Returns true if none of them return false.

Definition at line 1225 of file ItemLoader.cs.

1225 {
1226 EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1227 if (texture != null && !texture.DrawBody())
1228 return false;
1229
1230 foreach (var g in HookDrawBody.arr)
1231 if (!g.DrawBody(player.body))
1232 return false;
1233
1234 return true;
1235 }
static HookList HookDrawBody
Definition: ItemLoader.cs:1221

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawBody(), Terraria.ModLoader.EquipLoader.GetEquipTexture(), and Terraria.ModLoader.ItemLoader.HookDrawBody.

+ Here is the call graph for this function:

◆ DrawHair()

static void Terraria.ModLoader.ItemLoader.DrawHair ( Player  player,
ref bool  drawHair,
ref bool  drawAltHair 
)
static

Calls the item's head equipment texture's DrawHair hook, then all GlobalItem.DrawHair hooks.

Definition at line 1194 of file ItemLoader.cs.

1194 {
1195 EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1196 texture?.DrawHair(ref drawHair, ref drawAltHair);
1197
1198 foreach (var g in HookDrawHair.arr)
1199 g.DrawHair(player.head, ref drawHair, ref drawAltHair);
1200 }
static HookList HookDrawHair
Definition: ItemLoader.cs:1186

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawHair(), Terraria.ModLoader.EquipLoader.GetEquipTexture(), and Terraria.ModLoader.ItemLoader.HookDrawHair.

+ Here is the call graph for this function:

◆ DrawHands()

static void Terraria.ModLoader.ItemLoader.DrawHands ( Player  player,
ref bool  drawHands,
ref bool  drawArms 
)
static

Calls the item's body equipment texture's DrawHands hook, then all GlobalItem.DrawHands hooks.

Definition at line 1177 of file ItemLoader.cs.

1177 {
1178 EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1179 texture?.DrawHands(ref drawHands, ref drawArms);
1180
1181 foreach (var g in HookDrawHands.arr)
1182 g.DrawHands(player.body, ref drawHands, ref drawArms);
1183 }
static HookList HookDrawHands
Definition: ItemLoader.cs:1173

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawHands(), Terraria.ModLoader.EquipLoader.GetEquipTexture(), and Terraria.ModLoader.ItemLoader.HookDrawHands.

+ Here is the call graph for this function:

◆ DrawHead()

static bool Terraria.ModLoader.ItemLoader.DrawHead ( Player  player)
static

Calls the item's head equipment texture's DrawHead hook, then all GlobalItem.DrawHead hooks, until one of them returns false. Returns true if none of them return false.

Definition at line 1209 of file ItemLoader.cs.

1209 {
1210 EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1211 if (texture != null && !texture.DrawHead())
1212 return false;
1213
1214 foreach (var g in HookDrawHead.arr)
1215 if (!g.DrawHead(player.head))
1216 return false;
1217
1218 return true;
1219 }
static HookList HookDrawHead
Definition: ItemLoader.cs:1202

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawHead(), Terraria.ModLoader.EquipLoader.GetEquipTexture(), and Terraria.ModLoader.ItemLoader.HookDrawHead.

+ Here is the call graph for this function:

◆ DrawLegs()

static bool Terraria.ModLoader.ItemLoader.DrawLegs ( Player  player)
static

Calls the item's leg equipment texture's DrawLegs hook, then the item's shoe equipment texture's DrawLegs hook, then all GlobalItem.DrawLegs hooks, until one of them returns false. Returns true if none of them return false.

Definition at line 1241 of file ItemLoader.cs.

1241 {
1242 EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
1243 if (texture != null && !texture.DrawLegs())
1244 return false;
1245
1246 texture = EquipLoader.GetEquipTexture(EquipType.Shoes, player.shoe);
1247 if (texture != null && !texture.DrawLegs())
1248 return false;
1249
1250 foreach (var g in HookDrawLegs.arr)
1251 if (!g.DrawLegs(player.legs, player.shoe))
1252 return false;
1253
1254 return true;
1255 }
static HookList HookDrawLegs
Definition: ItemLoader.cs:1237

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawLegs(), Terraria.ModLoader.EquipLoader.GetEquipTexture(), and Terraria.ModLoader.ItemLoader.HookDrawLegs.

+ Here is the call graph for this function:

◆ ExtractinatorUse()

static void Terraria.ModLoader.ItemLoader.ExtractinatorUse ( ref int  resultType,
ref int  resultStack,
int  extractType 
)
static

Definition at line 1619 of file ItemLoader.cs.

1619 {
1620 GetItem(extractType)?.ExtractinatorUse(ref resultType, ref resultStack);
1621
1622 foreach (var g in HookExtractinatorUse.arr)
1623 g.ExtractinatorUse(extractType, ref resultType, ref resultStack);
1624 }
static HookList HookExtractinatorUse
Definition: ItemLoader.cs:1618
virtual void ExtractinatorUse(ref int resultType, ref int resultStack)
Allows you to modify what item, and in what quantity, is obtained when this item is fed into the Extr...
Definition: ModItem.cs:956

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.ModItem.ExtractinatorUse(), Terraria.ModLoader.ItemLoader.GetItem(), and Terraria.ModLoader.ItemLoader.HookExtractinatorUse.

+ Here is the call graph for this function:

◆ FindVanillaWings()

static void Terraria.ModLoader.ItemLoader.FindVanillaWings ( )
staticprivate

Definition at line 52 of file ItemLoader.cs.

52 {
53 if (vanillaWings[1] != 0)
54 return;
55
56 Item item = new Item();
57 for (int k = 0; k < ItemID.Count; k++) {
58 item.SetDefaults(k);
59 if (item.wingSlot > 0) {
60 vanillaWings[item.wingSlot] = k;
61 }
62 }
63 }

References Terraria.ModLoader.Item.

◆ GeneralPrefix()

static bool Terraria.ModLoader.ItemLoader.GeneralPrefix ( Item  item)
staticprivate

Definition at line 174 of file ItemLoader.cs.

174 {
175 return item.maxStack == 1 && item.damage > 0 && item.ammo == 0 && !item.accessory;
176 }

◆ GetAlpha()

static ? Color Terraria.ModLoader.ItemLoader.GetAlpha ( Item  item,
Color  lightColor 
)
static

Calls all GlobalItem.GetAlpha hooks then ModItem.GetAlpha, until one of them returns a color, and returns that color. Returns null if all of the hooks return null.

Definition at line 1484 of file ItemLoader.cs.

1484 {
1485 if (item.IsAir)
1486 return null;
1487
1488 foreach (var g in HookGetAlpha.arr) {
1489 Color? color = g.Instance(item).GetAlpha(item, lightColor);
1490 if (color.HasValue)
1491 return color;
1492 }
1493
1494 return item.modItem?.GetAlpha(lightColor);
1495 }
static HookList HookGetAlpha
Definition: ItemLoader.cs:1476

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookGetAlpha.

◆ GetHealLife()

static void Terraria.ModLoader.ItemLoader.GetHealLife ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
static

Calls ModItem.GetHealLife, then all GlobalItem.GetHealLife hooks.

Definition at line 397 of file ItemLoader.cs.

397 {
398 if (item.IsAir)
399 return;
400
401 item.modItem?.GetHealLife(player, quickHeal, ref healValue);
402
403 foreach (var g in HookGetHealLife.arr)
404 g.Instance(item).GetHealLife(item, player, quickHeal, ref healValue);
405 }
static HookList HookGetHealLife
Definition: ItemLoader.cs:393

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookGetHealLife.

◆ GetHealMana()

static void Terraria.ModLoader.ItemLoader.GetHealMana ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
static

Calls ModItem.GetHealMana, then all GlobalItem.GetHealMana hooks.

Definition at line 412 of file ItemLoader.cs.

412 {
413 if (item.IsAir)
414 return;
415
416 item.modItem?.GetHealMana(player, quickHeal, ref healValue);
417
418 foreach (var g in HookGetHealMana.arr)
419 g.Instance(item).GetHealMana(item, player, quickHeal, ref healValue);
420 }
static HookList HookGetHealMana
Definition: ItemLoader.cs:408

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookGetHealMana.

◆ GetItem()

static ModItem Terraria.ModLoader.ItemLoader.GetItem ( int  type)
static

Gets the ModItem instance corresponding to the specified type. Returns null if no modded item has the given type.

Definition at line 76 of file ItemLoader.cs.

76 {
77 return type >= ItemID.Count && type < ItemCount ? items[type - ItemID.Count] : null;
78 }

References Terraria.ModLoader.ItemLoader.ItemCount.

Referenced by Terraria.ModLoader.Mod.AddMusicBox(), Terraria.ModLoader.ItemLoader.AnglerChat(), Terraria.ModLoader.ItemLoader.ExtractinatorUse(), Terraria.ModLoader.ItemLoader.HoldoutOffset(), Terraria.ModLoader.ItemLoader.IsAnglerQuestAvailable(), and Terraria.ModLoader.ItemLoader.OpenBossBag().

+ Here is the caller graph for this function:

◆ GetWeaponCrit()

static void Terraria.ModLoader.ItemLoader.GetWeaponCrit ( Item  item,
Player  player,
ref int  crit 
)
static

Calls ModItem.GetWeaponCrit, then all GlobalItem.GetWeaponCrit hooks.

Definition at line 526 of file ItemLoader.cs.

526 {
527 if (item.IsAir)
528 return;
529
530 item.modItem?.GetWeaponCrit(player, ref crit);
531
532 foreach (var g in HookGetWeaponCrit.arr)
533 g.Instance(item).GetWeaponCrit(item, player, ref crit);
534 }
static HookList HookGetWeaponCrit
Definition: ItemLoader.cs:522

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookGetWeaponCrit.

◆ GetWeaponDamage()

static void Terraria.ModLoader.ItemLoader.GetWeaponDamage ( Item  item,
Player  player,
ref int  damage 
)
static

Calls ModItem.GetWeaponDamage, then all GlobalItem.GetWeaponDamage hooks.

Definition at line 475 of file ItemLoader.cs.

475 {
476 if (item.IsAir)
477 return;
478
479 item.modItem?.GetWeaponDamage(player, ref damage);
480
481 foreach (var g in HookGetWeaponDamage.arr)
482 g.Instance(item).GetWeaponDamage(item, player, ref damage);
483 }
static HookList HookGetWeaponDamage
Definition: ItemLoader.cs:470

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookGetWeaponDamage.

Referenced by Terraria.ModLoader.CombinedHooks.GetWeaponDamage().

+ Here is the caller graph for this function:

◆ GetWeaponKnockback()

static void Terraria.ModLoader.ItemLoader.GetWeaponKnockback ( Item  item,
Player  player,
ref float  knockback 
)
static

Calls ModItem.GetWeaponKnockback, then all GlobalItem.GetWeaponKnockback hooks.

Definition at line 510 of file ItemLoader.cs.

510 {
511 if (item.IsAir)
512 return;
513
514 item.modItem?.GetWeaponKnockback(player, ref knockback);
515
516 foreach (var g in HookGetWeaponKnockback.arr)
517 g.Instance(item).GetWeaponKnockback(item, player, ref knockback);
518 }
static HookList HookGetWeaponKnockback
Definition: ItemLoader.cs:506

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookGetWeaponKnockback.

◆ GetWing()

static Item Terraria.ModLoader.ItemLoader.GetWing ( Player  player)
static

s Returns the wing item that the player is functionally using. If player.wingsLogic has been modified, so no equipped wing can be found to match what the player is using, this creates a new Item object to return.

Definition at line 1287 of file ItemLoader.cs.

1287 {
1288 Item item = null;
1289 for (int k = 3; k < 8 + player.extraAccessorySlots; k++) {
1290 if (player.armor[k].wingSlot == player.wingsLogic) {
1291 item = player.armor[k];
1292 }
1293 }
1294 if (item != null) {
1295 return item;
1296 }
1297 if (player.wingsLogic > 0 && player.wingsLogic < Main.maxWings) {
1298 item = new Item();
1299 item.SetDefaults(vanillaWings[player.wingsLogic]);
1300 return item;
1301 }
1302 if (player.wingsLogic >= Main.maxWings) {
1303 EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1304 if (texture?.item != null)
1305 return texture.item.item;
1306 }
1307 return null;
1308 }

References Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.EquipTexture.item, Terraria.ModLoader.ModItem.item, and Terraria.ModLoader.Item.

Referenced by Terraria.ModLoader.ItemLoader.HorizontalWingSpeeds(), and Terraria.ModLoader.ItemLoader.VerticalWingSpeeds().

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

◆ GrabRange()

static void Terraria.ModLoader.ItemLoader.GrabRange ( Item  item,
Player  player,
ref int  grabRange 
)
static

Calls ModItem.GrabRange, then all GlobalItem.GrabRange hooks.

Definition at line 1419 of file ItemLoader.cs.

1419 {
1420 item.modItem?.GrabRange(player, ref grabRange);
1421
1422 foreach (var g in HookGrabRange.arr)
1423 g.Instance(item).GrabRange(item, player, ref grabRange);
1424 }
static HookList HookGrabRange
Definition: ItemLoader.cs:1413

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookGrabRange.

◆ GrabStyle()

static bool Terraria.ModLoader.ItemLoader.GrabStyle ( Item  item,
Player  player 
)
static

Calls all GlobalItem.GrabStyle hooks then ModItem.GrabStyle, until one of them returns true. Returns whether any of the hooks returned true.

Definition at line 1432 of file ItemLoader.cs.

1432 {
1433 foreach (var g in HookGrabStyle.arr)
1434 if (g.Instance(item).GrabStyle(item, player))
1435 return true;
1436
1437 return item.modItem != null && item.modItem.GrabStyle(player);
1438 }
static HookList HookGrabStyle
Definition: ItemLoader.cs:1426

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookGrabStyle.

◆ HasMethod()

static bool Terraria.ModLoader.ItemLoader.HasMethod ( Type  t,
string  method,
params Type[]  args 
)
staticprivate

Definition at line 1773 of file ItemLoader.cs.

1773 {
1774 return t.GetMethod(method, args).DeclaringType != typeof(GlobalItem);
1775 }

◆ HoldItem()

static void Terraria.ModLoader.ItemLoader.HoldItem ( Item  item,
Player  player 
)
static

Calls ModItem.HoldItem and all GlobalItem.HoldItem hooks.

Definition at line 356 of file ItemLoader.cs.

356 {
357 if (item.IsAir)
358 return;
359
360 item.modItem?.HoldItem(player);
361
362 foreach (var g in HookHoldItem.arr)
363 g.Instance(item).HoldItem(item, player);
364 }
static HookList HookHoldItem
Definition: ItemLoader.cs:351

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookHoldItem.

◆ HoldItemFrame()

static bool Terraria.ModLoader.ItemLoader.HoldItemFrame ( Item  item,
Player  player 
)
static

Calls ModItem.HoldItemFrame, then all GlobalItem.HoldItemFrame hooks, until one of them returns true. Returns whether any of the hooks returned true.

Definition at line 830 of file ItemLoader.cs.

830 {
831 if (item.IsAir)
832 return false;
833
834 if (item.modItem != null && item.modItem.HoldItemFrame(player))
835 return true;
836
837 foreach (var g in HookHoldItemFrame.arr)
838 if (g.Instance(item).HoldItemFrame(item, player))
839 return true;
840
841 return false;
842 }
static HookList HookHoldItemFrame
Definition: ItemLoader.cs:824

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookHoldItemFrame.

◆ HoldoutOffset()

static void Terraria.ModLoader.ItemLoader.HoldoutOffset ( float  gravDir,
int  type,
ref Vector2  offset 
)
static

Definition at line 1563 of file ItemLoader.cs.

1563 {
1564 ModItem modItem = GetItem(type);
1565 if (modItem != null) {
1566 Vector2? modOffset = modItem.HoldoutOffset();
1567 if (modOffset.HasValue) {
1568 offset.X = modOffset.Value.X;
1569 offset.Y += gravDir * modOffset.Value.Y;
1570 }
1571 }
1572 foreach (var g in HookHoldoutOffset.arr) {
1573 Vector2? modOffset = g.HoldoutOffset(type);
1574 if (modOffset.HasValue) {
1575 offset.X = modOffset.Value.X;
1576 offset.Y = Main.itemTexture[type].Height / 2f + gravDir * modOffset.Value.Y;
1577 }
1578 }
1579 }
static HookList HookHoldoutOffset
Definition: ItemLoader.cs:1562

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.ItemLoader.GetItem(), Terraria.ModLoader.ModItem.HoldoutOffset(), and Terraria.ModLoader.ItemLoader.HookHoldoutOffset.

+ Here is the call graph for this function:

◆ HoldoutOrigin()

static void Terraria.ModLoader.ItemLoader.HoldoutOrigin ( Player  player,
ref Vector2  origin 
)
static

Definition at line 1582 of file ItemLoader.cs.

1582 {
1583 Item item = player.inventory[player.selectedItem];
1584 Vector2 modOrigin = Vector2.Zero;
1585 if (item.modItem != null) {
1586 Vector2? modOrigin2 = item.modItem.HoldoutOrigin();
1587 if (modOrigin2.HasValue) {
1588 modOrigin = modOrigin2.Value;
1589 }
1590 }
1591 foreach (var g in HookHoldoutOrigin.arr) {
1592 Vector2? modOrigin2 = g.Instance(item).HoldoutOrigin(item.type);
1593 if (modOrigin2.HasValue) {
1594 modOrigin = modOrigin2.Value;
1595 }
1596 }
1597 modOrigin.X *= player.direction;
1598 modOrigin.Y *= -player.gravDir;
1599 origin += modOrigin;
1600 }
static HookList HookHoldoutOrigin
Definition: ItemLoader.cs:1581

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.ItemLoader.HookHoldoutOrigin, and Terraria.ModLoader.Item.

◆ HoldStyle()

static void Terraria.ModLoader.ItemLoader.HoldStyle ( Item  item,
Player  player 
)
static

If the player is not holding onto a rope and is not in the middle of using an item, calls ModItem.HoldStyle and all GlobalItem.HoldStyle hooks.

Definition at line 341 of file ItemLoader.cs.

341 {
342 if (item.IsAir || player.pulley || player.itemAnimation > 0)
343 return;
344
345 item.modItem?.HoldStyle(player);
346
347 foreach (var g in HookHoldStyle.arr)
348 g.Instance(item).HoldStyle(item, player);
349 }
static HookList HookHoldStyle
Definition: ItemLoader.cs:336

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookHoldStyle.

◆ HorizontalWingSpeeds()

static void Terraria.ModLoader.ItemLoader.HorizontalWingSpeeds ( Player  player)
static

If the player is using wings, this uses the result of GetWing, and calls ModItem.HorizontalWingSpeeds then all GlobalItem.HorizontalWingSpeeds hooks.

Definition at line 1343 of file ItemLoader.cs.

1343 {
1344 Item item = GetWing(player);
1345 if (item == null) {
1346 EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1347 texture?.HorizontalWingSpeeds(player, ref player.accRunSpeed, ref player.runAcceleration);
1348 return;
1349 }
1350
1351 item.modItem?.HorizontalWingSpeeds(player, ref player.accRunSpeed, ref player.runAcceleration);
1352
1353 foreach (var g in HookHorizontalWingSpeeds.arr)
1354 g.Instance(item).HorizontalWingSpeeds(item, player, ref player.accRunSpeed, ref player.runAcceleration);
1355 }
static Item GetWing(Player player)
s Returns the wing item that the player is functionally using. If player.wingsLogic has been modified...
Definition: ItemLoader.cs:1287
static HookList HookHorizontalWingSpeeds
Definition: ItemLoader.cs:1337

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.ItemLoader.GetWing(), Terraria.ModLoader.ItemLoader.HookHorizontalWingSpeeds, Terraria.ModLoader.EquipTexture.HorizontalWingSpeeds(), and Terraria.ModLoader.Item.

+ Here is the call graph for this function:

◆ IsAnglerQuestAvailable()

static void Terraria.ModLoader.ItemLoader.IsAnglerQuestAvailable ( int  itemID,
ref bool  notAvailable 
)
static

Definition at line 1649 of file ItemLoader.cs.

1649 {
1650 ModItem modItem = GetItem(itemID);
1651 if (modItem != null)
1652 notAvailable |= !modItem.IsAnglerQuestAvailable();
1653
1654 foreach (var g in HookIsAnglerQuestAvailable.arr)
1655 notAvailable |= !g.IsAnglerQuestAvailable(itemID);
1656 }
static HookList HookIsAnglerQuestAvailable
Definition: ItemLoader.cs:1648

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.ItemLoader.GetItem(), Terraria.ModLoader.ItemLoader.HookIsAnglerQuestAvailable, and Terraria.ModLoader.ModItem.IsAnglerQuestAvailable().

+ Here is the call graph for this function:

◆ IsModBossBag()

static bool Terraria.ModLoader.ItemLoader.IsModBossBag ( Item  item)
static

Returns whether ModItem.bossBagNPC is greater than 0. Returns false if item is not a modded item.

Definition at line 1087 of file ItemLoader.cs.

1087 {
1088 return item.modItem != null && item.modItem.BossBagNPC > 0;
1089 }

◆ ItemSpace()

static bool Terraria.ModLoader.ItemLoader.ItemSpace ( Item  item,
Player  player 
)
static

Definition at line 1468 of file ItemLoader.cs.

1468 {
1469 foreach (var g in HookItemSpace.arr)
1470 if (g.Instance(item).ItemSpace(item, player))
1471 return true;
1472
1473 return item.modItem?.ItemSpace(player) ?? false;
1474 }
static HookList HookItemSpace
Definition: ItemLoader.cs:1465

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookItemSpace.

◆ MeleeEffects()

static void Terraria.ModLoader.ItemLoader.MeleeEffects ( Item  item,
Player  player,
Rectangle  hitbox 
)
static

Calls ModItem.MeleeEffects and all GlobalItem.MeleeEffects hooks.

Definition at line 650 of file ItemLoader.cs.

650 {
651 item.modItem?.MeleeEffects(player, hitbox);
652
653 foreach (var g in HookMeleeEffects.arr)
654 g.Instance(item).MeleeEffects(item, player, hitbox);
655 }
static HookList HookMeleeEffects
Definition: ItemLoader.cs:644

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookMeleeEffects.

◆ MeleeSpeedMultiplier()

static float Terraria.ModLoader.ItemLoader.MeleeSpeedMultiplier ( Item  item,
Player  player 
)
static

Definition at line 380 of file ItemLoader.cs.

380 {
381 if (item.IsAir)
382 return 1f;
383
384 float multiplier = item.modItem?.MeleeSpeedMultiplier(player) ?? 1f;
385
386 foreach (var g in HookMeleeSpeedMultiplier.arr)
387 multiplier *= g.Instance(item).MeleeSpeedMultiplier(item, player);
388
389 return multiplier;
390 }
static HookList HookMeleeSpeedMultiplier
Definition: ItemLoader.cs:379

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookMeleeSpeedMultiplier.

Referenced by Terraria.ModLoader.PlayerHooks.TotalMeleeSpeedMultiplier().

+ Here is the caller graph for this function:

◆ ModifyHitNPC()

static void Terraria.ModLoader.ItemLoader.ModifyHitNPC ( Item  item,
Player  player,
NPC  target,
ref int  damage,
ref float  knockBack,
ref bool  crit 
)
static

Calls ModItem.ModifyHitNPC, then all GlobalItem.ModifyHitNPC hooks.

Definition at line 694 of file ItemLoader.cs.

694 {
695 item.modItem?.ModifyHitNPC(player, target, ref damage, ref knockBack, ref crit);
696
697 foreach (var g in HookModifyHitNPC.arr)
698 g.Instance(item).ModifyHitNPC(item, player, target, ref damage, ref knockBack, ref crit);
699 }
static HookList HookModifyHitNPC
Definition: ItemLoader.cs:688

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookModifyHitNPC.

◆ ModifyHitPvp()

static void Terraria.ModLoader.ItemLoader.ModifyHitPvp ( Item  item,
Player  player,
Player  target,
ref int  damage,
ref bool  crit 
)
static

Calls ModItem.ModifyHitPvp, then all GlobalItem.ModifyHitPvp hooks.

Definition at line 735 of file ItemLoader.cs.

735 {
736 item.modItem?.ModifyHitPvp(player, target, ref damage, ref crit);
737
738 foreach (var g in HookModifyHitPvp.arr)
739 g.Instance(item).ModifyHitPvp(item, player, target, ref damage, ref crit);
740 }
static HookList HookModifyHitPvp
Definition: ItemLoader.cs:729

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookModifyHitPvp.

◆ ModifyManaCost()

static void Terraria.ModLoader.ItemLoader.ModifyManaCost ( Item  item,
Player  player,
ref float  reduce,
ref float  mult 
)
static

Calls ModItem.ModifyManaCost, then all GlobalItem.ModifyManaCost hooks.

Definition at line 427 of file ItemLoader.cs.

427 {
428 if (item.IsAir)
429 return;
430
431 item.modItem?.ModifyManaCost(player, ref reduce, ref mult);
432
433 foreach (var g in HookModifyManaCost.arr) {
434 g.Instance(item).ModifyManaCost(item, player, ref reduce, ref mult);
435 }
436 }
static HookList HookModifyManaCost
Definition: ItemLoader.cs:423

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookModifyManaCost.

Referenced by Terraria.ModLoader.CombinedHooks.ModifyManaCost().

+ Here is the caller graph for this function:

◆ ModifyTooltips()

static List< TooltipLine > Terraria.ModLoader.ItemLoader.ModifyTooltips ( Item  item,
ref int  numTooltips,
string[]  names,
ref string[]  text,
ref bool[]  modifier,
ref bool[]  badModifier,
ref int  oneDropLogo,
out Color?[]  overrideColor 
)
static

Definition at line 1718 of file ItemLoader.cs.

1719 {
1720 List<TooltipLine> tooltips = new List<TooltipLine>();
1721 for (int k = 0; k < numTooltips; k++) {
1722 TooltipLine tooltip = new TooltipLine(names[k], text[k]);
1723 tooltip.isModifier = modifier[k];
1724 tooltip.isModifierBad = badModifier[k];
1725 if (k == oneDropLogo) {
1726 tooltip.oneDropLogo = true;
1727 }
1728 tooltips.Add(tooltip);
1729 }
1730 item.modItem?.ModifyTooltips(tooltips);
1731 foreach (var g in HookModifyTooltips.arr)
1732 g.Instance(item).ModifyTooltips(item, tooltips);
1733
1734 numTooltips = tooltips.Count;
1735 text = new string[numTooltips];
1736 modifier = new bool[numTooltips];
1737 badModifier = new bool[numTooltips];
1738 oneDropLogo = -1;
1739 overrideColor = new Color?[numTooltips];
1740 for (int k = 0; k < numTooltips; k++) {
1741 text[k] = tooltips[k].text;
1742 modifier[k] = tooltips[k].isModifier;
1743 badModifier[k] = tooltips[k].isModifierBad;
1744 if (tooltips[k].oneDropLogo) {
1745 oneDropLogo = k;
1746 }
1747 overrideColor[k] = tooltips[k].overrideColor;
1748 }
1749
1750 return tooltips;
1751 }
static HookList HookModifyTooltips
Definition: ItemLoader.cs:1717

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookModifyTooltips.

◆ ModifyWeaponDamage()

static void Terraria.ModLoader.ItemLoader.ModifyWeaponDamage ( Item  item,
Player  player,
ref float  add,
ref float  mult,
ref float  flat 
)
static

Calls ModItem.HookModifyWeaponDamage, then all GlobalItem.HookModifyWeaponDamage hooks.

Definition at line 492 of file ItemLoader.cs.

492 {
493 if (item.IsAir)
494 return;
495
496 item.modItem?.ModifyWeaponDamage(player, ref add, ref mult);
497 item.modItem?.ModifyWeaponDamage(player, ref add, ref mult, ref flat);
498
499 foreach (var g in HookModifyWeaponDamageOld.arr)
500 g.Instance(item).ModifyWeaponDamage(item, player, ref add, ref mult);
501 foreach (var g in HookModifyWeaponDamage.arr)
502 g.Instance(item).ModifyWeaponDamage(item, player, ref add, ref mult, ref flat);
503 }
static HookList HookModifyWeaponDamageOld
Definition: ItemLoader.cs:486
static HookList HookModifyWeaponDamage
Definition: ItemLoader.cs:488

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.ItemLoader.HookModifyWeaponDamage, and Terraria.ModLoader.ItemLoader.HookModifyWeaponDamageOld.

Referenced by Terraria.ModLoader.CombinedHooks.ModifyWeaponDamage().

+ Here is the caller graph for this function:

◆ NeedsModSaving()

static bool Terraria.ModLoader.ItemLoader.NeedsModSaving ( Item  item)
static

Definition at line 1754 of file ItemLoader.cs.

1754 {
1755 return item.type != 0 && (item.modItem != null || item.prefix >= PrefixID.Count || HookNeedsSaving.arr.Count(g => g.Instance(item).NeedsSaving(item)) > 0);
1756 }
static HookList HookNeedsSaving
Definition: ItemLoader.cs:1753

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookNeedsSaving.

◆ OnConsumeAmmo()

static void Terraria.ModLoader.ItemLoader.OnConsumeAmmo ( Item  item,
Item  ammo,
Player  player 
)
static

Calls ModItem.OnConsumeAmmo for the weapon, ModItem.OnConsumeAmmo for the ammo, then each GlobalItem.OnConsumeAmmo hook for the weapon and ammo.

Definition at line 587 of file ItemLoader.cs.

587 {
588 if (item.IsAir)
589 return;
590
591 item.modItem?.OnConsumeAmmo(player);
592 ammo.modItem?.OnConsumeAmmo(player);
593
594 foreach (var g in HookOnConsumeAmmo.arr) {
595 g.Instance(item).OnConsumeAmmo(item, player);
596 g.Instance(ammo).OnConsumeAmmo(ammo, player);
597 }
598 }
static HookList HookOnConsumeAmmo
Definition: ItemLoader.cs:583

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookOnConsumeAmmo.

◆ OnConsumeItem()

static void Terraria.ModLoader.ItemLoader.OnConsumeItem ( Item  item,
Player  player 
)
static

Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.

Definition at line 797 of file ItemLoader.cs.

797 {
798 if (item.IsAir)
799 return;
800
801 item.modItem?.OnConsumeItem(player);
802
803 foreach (var g in HookOnConsumeItem.arr)
804 g.Instance(item).OnConsumeItem(item, player);
805 }
static HookList HookOnConsumeItem
Definition: ItemLoader.cs:793

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookOnConsumeItem.

Referenced by Terraria.ModLoader.ItemLoader.ConsumeItem().

+ Here is the caller graph for this function:

◆ OnConsumeMana()

static void Terraria.ModLoader.ItemLoader.OnConsumeMana ( Item  item,
Player  player,
int  manaConsumed 
)
static

Calls ModItem.OnConsumeMana, then all GlobalItem.OnConsumeMana hooks.

Definition at line 457 of file ItemLoader.cs.

457 {
458 if (item.IsAir)
459 return;
460
461 item.modItem?.OnConsumeMana(player, manaConsumed);
462
463 foreach (var g in HookOnConsumeMana.arr) {
464 g.Instance(item).OnConsumeMana(item, player, manaConsumed);
465 }
466 }
static HookList HookOnConsumeMana
Definition: ItemLoader.cs:453

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookOnConsumeMana.

Referenced by Terraria.ModLoader.CombinedHooks.OnConsumeMana().

+ Here is the caller graph for this function:

◆ OnCraft()

static void Terraria.ModLoader.ItemLoader.OnCraft ( Item  item,
Recipe  recipe 
)
static

Definition at line 1675 of file ItemLoader.cs.

1675 {
1676 item.modItem?.OnCraft(recipe);
1677 foreach (var g in HookOnCraft.arr)
1678 g.Instance(item).OnCraft(item, recipe);
1679 }

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookOnCraft.

◆ OnHitNPC()

static void Terraria.ModLoader.ItemLoader.OnHitNPC ( Item  item,
Player  player,
NPC  target,
int  damage,
float  knockBack,
bool  crit 
)
static

Calls ModItem.OnHitNPC and all GlobalItem.OnHitNPC hooks.

Definition at line 707 of file ItemLoader.cs.

707 {
708 item.modItem?.OnHitNPC(player, target, damage, knockBack, crit);
709
710 foreach (var g in HookOnHitNPC.arr)
711 g.Instance(item).OnHitNPC(item, player, target, damage, knockBack, crit);
712 }
static HookList HookOnHitNPC
Definition: ItemLoader.cs:701

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookOnHitNPC.

◆ OnHitPvp()

static void Terraria.ModLoader.ItemLoader.OnHitPvp ( Item  item,
Player  player,
Player  target,
int  damage,
bool  crit 
)
static

Calls ModItem.OnHitPvp and all GlobalItem.OnHitPvp hooks.

Definition at line 748 of file ItemLoader.cs.

748 {
749 item.modItem?.OnHitPvp(player, target, damage, crit);
750
751 foreach (var g in HookOnHitPvp.arr)
752 g.Instance(item).OnHitPvp(item, player, target, damage, crit);
753 }
static HookList HookOnHitPvp
Definition: ItemLoader.cs:742

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookOnHitPvp.

◆ OnMissingMana()

static void Terraria.ModLoader.ItemLoader.OnMissingMana ( Item  item,
Player  player,
int  neededMana 
)
static

Calls ModItem.OnMissingMana, then all GlobalItem.OnMissingMana hooks.

Definition at line 442 of file ItemLoader.cs.

442 {
443 if (item.IsAir)
444 return;
445
446 item.modItem?.OnMissingMana(player, neededMana);
447
448 foreach (var g in HookOnMissingMana.arr) {
449 g.Instance(item).OnMissingMana(item, player, neededMana);
450 }
451 }
static HookList HookOnMissingMana
Definition: ItemLoader.cs:438

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookOnMissingMana.

Referenced by Terraria.ModLoader.CombinedHooks.OnMissingMana().

+ Here is the caller graph for this function:

◆ OnPickup()

static bool Terraria.ModLoader.ItemLoader.OnPickup ( Item  item,
Player  player 
)
static

Calls all GlobalItem.OnPickup hooks then ModItem.OnPickup, until one of the returns false. Returns true if all of the hooks return true.

Definition at line 1457 of file ItemLoader.cs.

1457 {
1458 foreach (var g in HookOnPickup.arr)
1459 if (!g.Instance(item).OnPickup(item, player))
1460 return false;
1461
1462 return item.modItem?.OnPickup(player) ?? true;
1463 }
static HookList HookOnPickup
Definition: ItemLoader.cs:1451

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookOnPickup.

◆ OpenBossBag()

static void Terraria.ModLoader.ItemLoader.OpenBossBag ( int  type,
Player  player,
ref int  npc 
)
static

If the item is a modded item and ModItem.bossBagNPC is greater than 0, calls ModItem.OpenBossBag and sets npc to ModItem.bossBagNPC.

Definition at line 1096 of file ItemLoader.cs.

1096 {
1097 ModItem modItem = GetItem(type);
1098 if (modItem != null && modItem.BossBagNPC > 0) {
1099 modItem.OpenBossBag(player);
1100 npc = modItem.BossBagNPC;
1101 }
1102 }

References Terraria.ModLoader.ModItem.BossBagNPC, Terraria.ModLoader.ItemLoader.GetItem(), and Terraria.ModLoader.ModItem.OpenBossBag().

+ Here is the call graph for this function:

◆ OpenVanillaBag()

static void Terraria.ModLoader.ItemLoader.OpenVanillaBag ( string  context,
Player  player,
int  arg 
)
static

Calls all GlobalItem.OpenVanillaBag hooks.

Definition at line 1131 of file ItemLoader.cs.

1131 {
1132 foreach (var g in HookOpenVanillaBag.arr)
1133 g.OpenVanillaBag(context, player, arg);
1134 }
static HookList HookOpenVanillaBag
Definition: ItemLoader.cs:1125

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookOpenVanillaBag.

◆ PickAmmo()

static void Terraria.ModLoader.ItemLoader.PickAmmo ( Item  weapon,
Item  ammo,
Player  player,
ref int  type,
ref float  speed,
ref int  damage,
ref float  knockback 
)
static

Calls ModItem.PickAmmo, then all GlobalItem.PickAmmo hooks.

Definition at line 551 of file ItemLoader.cs.

551 {
552 ammo.modItem?.PickAmmo(weapon, player, ref type, ref speed, ref damage, ref knockback);
553 ammo.modItem?.PickAmmo(player, ref type, ref speed, ref damage, ref knockback); // deprecated
554
555 foreach (var g in HookPickAmmo.arr) {
556 g.Instance(ammo).PickAmmo(weapon, ammo, player, ref type, ref speed, ref damage, ref knockback);
557 }
558 foreach (var g in HookOldPickAmmo.arr) {
559 g.Instance(ammo).PickAmmo(ammo, player, ref type, ref speed, ref damage, ref knockback); // deprecated
560 }
561 }
static HookList HookPickAmmo
Definition: ItemLoader.cs:547
static HookList HookOldPickAmmo
Definition: ItemLoader.cs:544

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.ItemLoader.HookOldPickAmmo, and Terraria.ModLoader.ItemLoader.HookPickAmmo.

◆ PostDrawInInventory()

static void Terraria.ModLoader.ItemLoader.PostDrawInInventory ( Item  item,
SpriteBatch  spriteBatch,
Vector2  position,
Rectangle  frame,
Color  drawColor,
Color  itemColor,
Vector2  origin,
float  scale 
)
static

Calls ModItem.PostDrawInInventory, then all GlobalItem.PostDrawInInventory hooks.

Definition at line 1554 of file ItemLoader.cs.

1555 {
1556 item.modItem?.PostDrawInInventory(spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1557
1558 foreach (var g in HookPostDrawInInventory.arr)
1559 g.Instance(item).PostDrawInInventory(item, spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1560 }
static HookList HookPostDrawInInventory
Definition: ItemLoader.cs:1547

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPostDrawInInventory.

◆ PostDrawInWorld()

static void Terraria.ModLoader.ItemLoader.PostDrawInWorld ( Item  item,
SpriteBatch  spriteBatch,
Color  lightColor,
Color  alphaColor,
float  rotation,
float  scale,
int  whoAmI 
)
static

Calls ModItem.PostDrawInWorld, then all GlobalItem.PostDrawInWorld hooks.

Definition at line 1521 of file ItemLoader.cs.

1521 {
1522 item.modItem?.PostDrawInWorld(spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI);
1523
1524 foreach (var g in HookPostDrawInWorld.arr)
1525 g.Instance(item).PostDrawInWorld(item, spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI);
1526 }
static HookList HookPostDrawInWorld
Definition: ItemLoader.cs:1515

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPostDrawInWorld.

◆ PostDrawTooltip()

static void Terraria.ModLoader.ItemLoader.PostDrawTooltip ( Item  item,
ReadOnlyCollection< DrawableTooltipLine lines 
)
static

Definition at line 1693 of file ItemLoader.cs.

1693 {
1694 item.modItem?.PostDrawTooltip(lines);
1695 foreach (var g in HookPostDrawTooltip.arr)
1696 g.Instance(item).PostDrawTooltip(item, lines);
1697 }
static HookList HookPostDrawTooltip
Definition: ItemLoader.cs:1692

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPostDrawTooltip.

◆ PostDrawTooltipLine()

static void Terraria.ModLoader.ItemLoader.PostDrawTooltipLine ( Item  item,
DrawableTooltipLine  line 
)
static

Definition at line 1711 of file ItemLoader.cs.

1711 {
1712 item.modItem?.PostDrawTooltipLine(line);
1713 foreach (var g in HookPostDrawTooltipLine.arr)
1714 g.Instance(item).PostDrawTooltipLine(item, line);
1715 }
static HookList HookPostDrawTooltipLine
Definition: ItemLoader.cs:1710

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPostDrawTooltipLine.

◆ PostReforge()

static void Terraria.ModLoader.ItemLoader.PostReforge ( Item  item)
static

Calls ModItem.PostReforge, then all GlobalItem.PostReforge hooks.

Definition at line 1166 of file ItemLoader.cs.

1166 {
1167 item.modItem?.PostReforge();
1168 foreach (var g in HookPostReforge.arr)
1169 g.Instance(item).PostReforge(item);
1170 }
static HookList HookPostReforge
Definition: ItemLoader.cs:1162

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPostReforge.

◆ PostUpdate()

static void Terraria.ModLoader.ItemLoader.PostUpdate ( Item  item)
static

Calls ModItem.PostUpdate and all GlobalItem.PostUpdate hooks.

Definition at line 1405 of file ItemLoader.cs.

1405 {
1406 item.modItem?.PostUpdate();
1407
1408 foreach (var g in HookPostUpdate.arr)
1409 g.Instance(item).PostUpdate(item);
1410 }
static HookList HookPostUpdate
Definition: ItemLoader.cs:1401

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPostUpdate.

◆ PreDrawInInventory()

static bool Terraria.ModLoader.ItemLoader.PreDrawInInventory ( Item  item,
SpriteBatch  spriteBatch,
Vector2  position,
Rectangle  frame,
Color  drawColor,
Color  itemColor,
Vector2  origin,
float  scale 
)
static

Returns the "and" operator on the results of all GlobalItem.PreDrawInInventory hooks and ModItem.PreDrawInInventory.

Definition at line 1535 of file ItemLoader.cs.

1536 {
1537 bool flag = true;
1538 foreach (var g in HookPreDrawInInventory.arr)
1539 flag &= g.Instance(item).PreDrawInInventory(item, spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1540
1541 if (item.modItem != null)
1542 flag &= item.modItem.PreDrawInInventory(spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1543
1544 return flag;
1545 }
static HookList HookPreDrawInInventory
Definition: ItemLoader.cs:1528

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPreDrawInInventory.

◆ PreDrawInWorld()

static bool Terraria.ModLoader.ItemLoader.PreDrawInWorld ( Item  item,
SpriteBatch  spriteBatch,
Color  lightColor,
Color  alphaColor,
ref float  rotation,
ref float  scale,
int  whoAmI 
)
static

Returns the "and" operator on the results of ModItem.PreDrawInWorld and all GlobalItem.PreDrawInWorld hooks.

Definition at line 1504 of file ItemLoader.cs.

1504 {
1505 bool flag = true;
1506 if (item.modItem != null)
1507 flag &= item.modItem.PreDrawInWorld(spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI);
1508
1509 foreach (var g in HookPreDrawInWorld.arr)
1510 flag &= g.Instance(item).PreDrawInWorld(item, spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI);
1511
1512 return flag;
1513 }
static HookList HookPreDrawInWorld
Definition: ItemLoader.cs:1498

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPreDrawInWorld.

◆ PreDrawTooltip()

static bool Terraria.ModLoader.ItemLoader.PreDrawTooltip ( Item  item,
ReadOnlyCollection< TooltipLine lines,
ref int  x,
ref int  y 
)
static

Definition at line 1683 of file ItemLoader.cs.

1683 {
1684 bool modItemPreDraw = item.modItem?.PreDrawTooltip(lines, ref x, ref y) ?? true;
1685 List<bool> globalItemPreDraw = new List<bool>();
1686 foreach (var g in HookPreDrawTooltip.arr)
1687 globalItemPreDraw.Add(g.PreDrawTooltip(item, lines, ref x, ref y));
1688 return modItemPreDraw && globalItemPreDraw.All(z => z);
1689 }
static HookList HookPreDrawTooltip
Definition: ItemLoader.cs:1682

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPreDrawTooltip.

◆ PreDrawTooltipLine()

static bool Terraria.ModLoader.ItemLoader.PreDrawTooltipLine ( Item  item,
DrawableTooltipLine  line,
ref int  yOffset 
)
static

Definition at line 1701 of file ItemLoader.cs.

1701 {
1702 bool modItemPreDrawLine = item.modItem?.PreDrawTooltipLine(line, ref yOffset) ?? true;
1703 List<bool> globalItemPreDrawLine = new List<bool>();
1704 foreach (var g in HookPreDrawTooltipLine.arr)
1705 globalItemPreDrawLine.Add(g.PreDrawTooltipLine(item, line, ref yOffset));
1706 return modItemPreDrawLine && globalItemPreDrawLine.All(x => x);
1707 }
static HookList HookPreDrawTooltipLine
Definition: ItemLoader.cs:1700

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPreDrawTooltipLine.

◆ PrefixChance()

static ? bool Terraria.ModLoader.ItemLoader.PrefixChance ( Item  item,
int  pre,
UnifiedRandom  rand 
)
static

Allows for blocking, forcing and altering chance of prefix rolling. False (block) takes precedence over True (force). Null gives vanilla behaviour

Definition at line 273 of file ItemLoader.cs.

273 {
274 bool? result = null;
275 foreach (var g in HookPrefixChance.arr) {
276 bool? r = g.Instance(item).PrefixChance(item, pre, rand);
277 if (r.HasValue)
278 result = r.Value && (result ?? true);
279 }
280 if (item.modItem != null) {
281 bool? r = item.modItem.PrefixChance(pre, rand);
282 if (r.HasValue)
283 result = r.Value && (result ?? true);
284 }
285 return result;
286 }
static HookList HookPrefixChance
Definition: ItemLoader.cs:266

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPrefixChance.

◆ PreOpenVanillaBag()

static bool Terraria.ModLoader.ItemLoader.PreOpenVanillaBag ( string  context,
Player  player,
int  arg 
)
static

Calls each GlobalItem.PreOpenVanillaBag hook until one of them returns false. Returns true if all of them returned true.

Definition at line 1112 of file ItemLoader.cs.

1112 {
1113 bool result = true;
1114 foreach (var g in HookPreOpenVanillaBag.arr)
1115 result &= g.PreOpenVanillaBag(context, player, arg);
1116
1117 if (!result) {
1118 NPCLoader.blockLoot.Clear(); // clear blockloot
1119 return false;
1120 }
1121
1122 return true;
1123 }
static HookList HookPreOpenVanillaBag
Definition: ItemLoader.cs:1104

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.NPCLoader.blockLoot, and Terraria.ModLoader.ItemLoader.HookPreOpenVanillaBag.

◆ PreReforge()

static bool Terraria.ModLoader.ItemLoader.PreReforge ( Item  item)
static

Calls ModItem.PreReforge, then all GlobalItem.PreReforge hooks.

Definition at line 1155 of file ItemLoader.cs.

1155 {
1156 bool b = item.modItem?.NewPreReforge() ?? true;
1157 foreach (var g in HookPreReforge.arr)
1158 b &= g.Instance(item).NewPreReforge(item);
1159 return b;
1160 }
static HookList HookPreReforge
Definition: ItemLoader.cs:1151

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookPreReforge.

◆ PreUpdateVanitySet()

static void Terraria.ModLoader.ItemLoader.PreUpdateVanitySet ( Player  player)
static

If the player's head texture's IsVanitySet returns true, calls the equipment texture's PreUpdateVanitySet. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.PreUpdateVanitySet, using player.head, player.body, and player.legs.

Definition at line 948 of file ItemLoader.cs.

948 {
949 EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
950 EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
951 EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
952 if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
953 headTexture.PreUpdateVanitySet(player);
954
955 if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
956 bodyTexture.PreUpdateVanitySet(player);
957
958 if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
959 legTexture.PreUpdateVanitySet(player);
960
961 foreach (GlobalItem globalItem in HookPreUpdateVanitySet.arr) {
962 string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
963 if (!string.IsNullOrEmpty(set))
964 globalItem.PreUpdateVanitySet(player, set);
965 }
966 }
static HookList HookPreUpdateVanitySet
Definition: ItemLoader.cs:943

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.ItemLoader.HookPreUpdateVanitySet, Terraria.ModLoader.EquipTexture.IsVanitySet(), Terraria.ModLoader.GlobalItem.IsVanitySet(), Terraria.ModLoader.EquipTexture.PreUpdateVanitySet(), and Terraria.ModLoader.GlobalItem.PreUpdateVanitySet().

+ Here is the call graph for this function:

◆ ReforgePrice()

static bool Terraria.ModLoader.ItemLoader.ReforgePrice ( Item  item,
ref int  reforgePrice,
ref bool  canApplyDiscount 
)
static

Call all ModItem.ReforgePrice, then GlobalItem.ReforgePrice hooks.

Parameters
canApplyDiscount
Returns

Definition at line 1143 of file ItemLoader.cs.

1143 {
1144 bool b = item.modItem?.ReforgePrice(ref reforgePrice, ref canApplyDiscount) ?? true;
1145 foreach (var g in HookReforgePrice.arr)
1146 b &= g.Instance(item).ReforgePrice(item, ref reforgePrice, ref canApplyDiscount);
1147 return b;
1148 }
static HookList HookReforgePrice
Definition: ItemLoader.cs:1137

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookReforgePrice.

◆ RightClick()

static void Terraria.ModLoader.ItemLoader.RightClick ( Item  item,
Player  player 
)
static

If Main.mouseRightRelease is true, the following steps are taken:

  1. Call ModItem.RightClick
  2. Calls all GlobalItem.RightClick hooks
  3. Call ItemLoader.ConsumeItem, and if it returns true, decrements the item's stack
  4. Sets the item's type to 0 if the item's stack is 0
  5. Plays the item-grabbing sound
  6. Sets Main.stackSplit to 30
  7. Sets Main.mouseRightRelease to false
  8. Calls Recipe.FindRecipes.

Definition at line 1065 of file ItemLoader.cs.

1065 {
1066 if (!Main.mouseRightRelease)
1067 return;
1068
1069 item.modItem?.RightClick(player);
1070
1071 foreach (var g in HookRightClick.arr)
1072 g.Instance(item).RightClick(item, player);
1073
1074 if (ConsumeItem(item, player) && --item.stack == 0)
1075 item.SetDefaults();
1076
1077 Main.PlaySound(7);
1078 Main.stackSplit = 30;
1079 Main.mouseRightRelease = false;
1080 Recipe.FindRecipes();
1081 }
static bool ConsumeItem(Item item, Player player)
If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to fals...
Definition: ItemLoader.cs:780
static HookList HookRightClick
Definition: ItemLoader.cs:1052

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.ItemLoader.ConsumeItem(), and Terraria.ModLoader.ItemLoader.HookRightClick.

+ Here is the call graph for this function:

◆ SetMatch()

static void Terraria.ModLoader.ItemLoader.SetMatch ( int  armorSlot,
int  type,
bool  male,
ref int  equipSlot,
ref bool  robes 
)
static

Calls EquipTexture.SetMatch, then all GlobalItem.SetMatch hooks.


Definition at line 1024 of file ItemLoader.cs.

1024 {
1025 EquipTexture texture = EquipLoader.GetEquipTexture((EquipType)armorSlot, type);
1026 texture?.SetMatch(male, ref equipSlot, ref robes);
1027
1028 foreach (var g in HookSetMatch.arr)
1029 g.SetMatch(armorSlot, type, male, ref equipSlot, ref robes);
1030 }
static HookList HookSetMatch
Definition: ItemLoader.cs:1020

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.ItemLoader.HookSetMatch, and Terraria.ModLoader.EquipTexture.SetMatch().

+ Here is the call graph for this function:

◆ Shoot()

static bool Terraria.ModLoader.ItemLoader.Shoot ( Item  item,
Player  player,
ref Vector2  position,
ref float  speedX,
ref float  speedY,
ref int  type,
ref int  damage,
ref float  knockBack 
)
static

Calls each GlobalItem.Shoot hook, then ModItem.Shoot, until one of them returns false. If all of them return true, returns true.

Parameters
itemThe weapon item.
playerThe player.
positionThe shoot spawn position.
speedXThe speed x calculated from shootSpeed and mouse position.
speedYThe speed y calculated from shootSpeed and mouse position.
typeThe projectile type choosen by ammo and weapon.
damageThe projectile damage.
knockBackThe projectile knock back.
Returns

Definition at line 616 of file ItemLoader.cs.

616 {
617 bool result = true;
618
619 foreach (var g in HookShoot.arr) {
620 result &= g.Instance(item).Shoot(item, player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack);
621 }
622
623 if (result && item.modItem != null) {
624 return item.modItem.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack);
625 }
626
627 return result;
628 }

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookShoot.

◆ Update()

static void Terraria.ModLoader.ItemLoader.Update ( Item  item,
ref float  gravity,
ref float  maxFallSpeed 
)
static

Calls ModItem.Update, then all GlobalItem.Update hooks.

Definition at line 1381 of file ItemLoader.cs.

1381 {
1382 item.modItem?.Update(ref gravity, ref maxFallSpeed);
1383
1384 foreach (var g in HookUpdate.arr)
1385 g.Instance(item).Update(item, ref gravity, ref maxFallSpeed);
1386 }

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookUpdate.

◆ UpdateAccessory()

static void Terraria.ModLoader.ItemLoader.UpdateAccessory ( Item  item,
Player  player,
bool  hideVisual 
)
static

Calls ModItem.UpdateAccessory and all GlobalItem.UpdateAccessory hooks.

Definition at line 900 of file ItemLoader.cs.

900 {
901 if (item.IsAir)
902 return;
903
904 item.modItem?.UpdateAccessory(player, hideVisual);
905
906 foreach (var g in HookUpdateAccessory.arr)
907 g.Instance(item).UpdateAccessory(item, player, hideVisual);
908 }
static HookList HookUpdateAccessory
Definition: ItemLoader.cs:894

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookUpdateAccessory.

◆ UpdateArmorSet()

static void Terraria.ModLoader.ItemLoader.UpdateArmorSet ( Player  player,
Item  head,
Item  body,
Item  legs 
)
static

If the head's ModItem.IsArmorSet returns true, calls the head's ModItem.UpdateArmorSet. This is then repeated for the body, then the legs. Then for each GlobalItem, if GlobalItem.IsArmorSet returns a non-empty string, calls GlobalItem.UpdateArmorSet with that string.

Definition at line 926 of file ItemLoader.cs.

926 {
927 if (head.modItem != null && head.modItem.IsArmorSet(head, body, legs))
928 head.modItem.UpdateArmorSet(player);
929
930 if (body.modItem != null && body.modItem.IsArmorSet(head, body, legs))
931 body.modItem.UpdateArmorSet(player);
932
933 if (legs.modItem != null && legs.modItem.IsArmorSet(head, body, legs))
934 legs.modItem.UpdateArmorSet(player);
935
936 foreach (GlobalItem globalItem in HookUpdateArmorSet.arr) {
937 string set = globalItem.IsArmorSet(head, body, legs);
938 if (!string.IsNullOrEmpty(set))
939 globalItem.UpdateArmorSet(player, set);
940 }
941 }
static HookList HookUpdateArmorSet
Definition: ItemLoader.cs:921

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.ItemLoader.HookUpdateArmorSet, Terraria.ModLoader.GlobalItem.IsArmorSet(), and Terraria.ModLoader.GlobalItem.UpdateArmorSet().

+ Here is the call graph for this function:

◆ UpdateEquip()

static void Terraria.ModLoader.ItemLoader.UpdateEquip ( Item  item,
Player  player 
)
static

Calls ModItem.UpdateEquip and all GlobalItem.UpdateEquip hooks.

Definition at line 884 of file ItemLoader.cs.

884 {
885 if (item.IsAir)
886 return;
887
888 item.modItem?.UpdateEquip(player);
889
890 foreach (var g in HookUpdateEquip.arr)
891 g.Instance(item).UpdateEquip(item, player);
892 }
static HookList HookUpdateEquip
Definition: ItemLoader.cs:878

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookUpdateEquip.

◆ UpdateInventory()

static void Terraria.ModLoader.ItemLoader.UpdateInventory ( Item  item,
Player  player 
)
static

Calls ModItem.UpdateInventory and all GlobalItem.UpdateInventory hooks.

Definition at line 868 of file ItemLoader.cs.

868 {
869 if (item.IsAir)
870 return;
871
872 item.modItem?.UpdateInventory(player);
873
874 foreach (var g in HookUpdateInventory.arr)
875 g.Instance(item).UpdateInventory(item, player);
876 }
static HookList HookUpdateInventory
Definition: ItemLoader.cs:862

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookUpdateInventory.

◆ UpdateVanity()

static void Terraria.ModLoader.ItemLoader.UpdateVanity ( Player  player)
static

Calls each of the item's equipment texture's UpdateVanity hook.

Definition at line 913 of file ItemLoader.cs.

913 {
914 foreach (EquipType type in EquipLoader.EquipTypes) {
915 int slot = EquipLoader.GetPlayerEquip(player, type);
916 EquipTexture texture = EquipLoader.GetEquipTexture(type, slot);
917 texture?.UpdateVanity(player, type);
918 }
919 }

References Terraria.ModLoader.EquipLoader.EquipTypes, Terraria.ModLoader.EquipLoader.GetEquipTexture(), and Terraria.ModLoader.EquipTexture.UpdateVanity().

+ Here is the call graph for this function:

◆ UpdateVanitySet()

static void Terraria.ModLoader.ItemLoader.UpdateVanitySet ( Player  player)
static

If the player's head texture's IsVanitySet returns true, calls the equipment texture's UpdateVanitySet. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.UpdateVanitySet, using player.head, player.body, and player.legs.

Definition at line 973 of file ItemLoader.cs.

973 {
974 EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
975 EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
976 EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
977 if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
978 headTexture.UpdateVanitySet(player);
979
980 if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
981 bodyTexture.UpdateVanitySet(player);
982
983 if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
984 legTexture.UpdateVanitySet(player);
985
986 foreach (GlobalItem globalItem in HookUpdateVanitySet.arr) {
987 string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
988 if (!string.IsNullOrEmpty(set))
989 globalItem.UpdateVanitySet(player, set);
990 }
991 }
static HookList HookUpdateVanitySet
Definition: ItemLoader.cs:968

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.ItemLoader.HookUpdateVanitySet, Terraria.ModLoader.EquipTexture.IsVanitySet(), Terraria.ModLoader.GlobalItem.IsVanitySet(), Terraria.ModLoader.EquipTexture.UpdateVanitySet(), and Terraria.ModLoader.GlobalItem.UpdateVanitySet().

+ Here is the call graph for this function:

◆ UseItem()

static bool Terraria.ModLoader.ItemLoader.UseItem ( Item  item,
Player  player 
)
static

Returns true if any of ModItem.UseItem or GlobalItem.UseItem return true Does not fail fast (calls every hook)

Definition at line 760 of file ItemLoader.cs.

760 {
761 if (item.IsAir)
762 return false;
763
764 bool flag = false;
765 if (item.modItem != null)
766 flag |= item.modItem.UseItem(player);
767
768 foreach (var g in HookUseItem.arr)
769 flag |= g.Instance(item).UseItem(item, player);
770
771 return flag;
772 }
static HookList HookUseItem
Definition: ItemLoader.cs:755

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookUseItem.

◆ UseItemFrame()

static bool Terraria.ModLoader.ItemLoader.UseItemFrame ( Item  item,
Player  player 
)
static

Calls ModItem.UseItemFrame, then all GlobalItem.UseItemFrame hooks, until one of them returns true. Returns whether any of the hooks returned true.

Definition at line 813 of file ItemLoader.cs.

813 {
814 if (item.modItem != null && item.modItem.UseItemFrame(player))
815 return true;
816
817 foreach (var g in HookUseItemFrame.arr)
818 if (g.Instance(item).UseItemFrame(item, player))
819 return true;
820
821 return false;
822 }
static HookList HookUseItemFrame
Definition: ItemLoader.cs:807

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookUseItemFrame.

◆ UseItemHitbox()

static void Terraria.ModLoader.ItemLoader.UseItemHitbox ( Item  item,
Player  player,
ref Rectangle  hitbox,
ref bool  noHitbox 
)
static

Calls ModItem.UseItemHitbox, then all GlobalItem.UseItemHitbox hooks.

Definition at line 637 of file ItemLoader.cs.

637 {
638 item.modItem?.UseItemHitbox(player, ref hitbox, ref noHitbox);
639
640 foreach (var g in HookUseItemHitbox.arr)
641 g.Instance(item).UseItemHitbox(item, player, ref hitbox, ref noHitbox);
642 }
static HookList HookUseItemHitbox
Definition: ItemLoader.cs:631

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookUseItemHitbox.

◆ UseStyle()

static void Terraria.ModLoader.ItemLoader.UseStyle ( Item  item,
Player  player 
)
static

Calls ModItem.UseStyle and all GlobalItem.UseStyle hooks.

Definition at line 326 of file ItemLoader.cs.

326 {
327 if (item.IsAir)
328 return;
329
330 item.modItem?.UseStyle(player);
331
332 foreach (var g in HookUseStyle.arr)
333 g.Instance(item).UseStyle(item, player);
334 }
static HookList HookUseStyle
Definition: ItemLoader.cs:321

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookUseStyle.

◆ UseTimeMultiplier()

static float Terraria.ModLoader.ItemLoader.UseTimeMultiplier ( Item  item,
Player  player 
)
static

Definition at line 367 of file ItemLoader.cs.

367 {
368 if (item.IsAir)
369 return 1f;
370
371 float multiplier = item.modItem?.UseTimeMultiplier(player) ?? 1f;
372
373 foreach (var g in HookUseTimeMultiplier.arr)
374 multiplier *= g.Instance(item).UseTimeMultiplier(item, player);
375
376 return multiplier;
377 }
static HookList HookUseTimeMultiplier
Definition: ItemLoader.cs:366

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ItemLoader.HookUseTimeMultiplier.

Referenced by Terraria.ModLoader.PlayerHooks.TotalUseTimeMultiplier().

+ Here is the caller graph for this function:

◆ VerticalWingSpeeds()

static void Terraria.ModLoader.ItemLoader.VerticalWingSpeeds ( Player  player,
ref float  ascentWhenFalling,
ref float  ascentWhenRising,
ref float  maxCanAscendMultiplier,
ref float  maxAscentMultiplier,
ref float  constantAscend 
)
static

If the player is using wings, this uses the result of GetWing, and calls ModItem.VerticalWingSpeeds then all GlobalItem.VerticalWingSpeeds hooks.

Definition at line 1317 of file ItemLoader.cs.

1318 {
1319 Item item = GetWing(player);
1320 if (item == null) {
1321 EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1322 texture?.VerticalWingSpeeds(
1323 player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
1324 ref maxAscentMultiplier, ref constantAscend);
1325 return;
1326 }
1327
1328 item.modItem?.VerticalWingSpeeds(player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
1329 ref maxAscentMultiplier, ref constantAscend);
1330
1331 foreach (var g in HookVerticalWingSpeeds.arr)
1332 g.Instance(item).VerticalWingSpeeds(item, player, ref ascentWhenFalling, ref ascentWhenRising,
1333 ref maxCanAscendMultiplier, ref maxAscentMultiplier, ref constantAscend);
1334 }
static HookList HookVerticalWingSpeeds
Definition: ItemLoader.cs:1311

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.ItemLoader.GetWing(), Terraria.ModLoader.ItemLoader.HookVerticalWingSpeeds, Terraria.ModLoader.Item, and Terraria.ModLoader.EquipTexture.VerticalWingSpeeds().

+ Here is the call graph for this function:

◆ WingUpdate()

static bool Terraria.ModLoader.ItemLoader.WingUpdate ( Player  player,
bool  inUse 
)
static

If wings can be seen on the player, calls the player's wing's equipment texture's WingUpdate and all GlobalItem.WingUpdate hooks.

Definition at line 1361 of file ItemLoader.cs.

1361 {
1362 if (player.wings <= 0)
1363 return false;
1364
1365 EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wings);
1366 bool? retVal = texture?.WingUpdate(player, inUse);
1367
1368 foreach (var g in HookWingUpdate.arr)
1369 retVal |= g.WingUpdate(player.wings, player, inUse);
1370
1371 return retVal ?? false;
1372 }
static HookList HookWingUpdate
Definition: ItemLoader.cs:1357

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.ItemLoader.HookWingUpdate, and Terraria.ModLoader.EquipTexture.WingUpdate().

+ Here is the call graph for this function:

Member Data Documentation

◆ HookAllowPrefix

HookList Terraria.ModLoader.ItemLoader.HookAllowPrefix = AddHook<Func<Item, int, bool>>(g => g.AllowPrefix)
staticprivate

Definition at line 288 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.AllowPrefix().

◆ HookAltFunctionUse

HookList Terraria.ModLoader.ItemLoader.HookAltFunctionUse = AddHook<Func<Item, Player, bool>>(g => g.AltFunctionUse)
staticprivate

Definition at line 844 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.AltFunctionUse().

◆ HookAnglerChat

HookList Terraria.ModLoader.ItemLoader.HookAnglerChat = AddHook<DelegateAnglerChat>(g => g.AnglerChat)
staticprivate

Definition at line 1659 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.AnglerChat().

◆ HookArmorArmGlowMask

HookList Terraria.ModLoader.ItemLoader.HookArmorArmGlowMask = AddHook<DelegateArmorArmGlowMask>(g => g.ArmorArmGlowMask)
staticprivate

Definition at line 1272 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ArmorArmGlowMask().

◆ HookArmorSetShadows

HookList Terraria.ModLoader.ItemLoader.HookArmorSetShadows = AddHook<Action<Player, string>>(g => g.ArmorSetShadows)
staticprivate

Definition at line 993 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ArmorSetShadows().

◆ HookCanBurnInLava

HookList Terraria.ModLoader.ItemLoader.HookCanBurnInLava = AddHook<Func<Item, bool>>(g => g.CanBurnInLava)
staticprivate

Definition at line 1388 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.CanBurnInLava().

◆ HookCanEquipAccessory

HookList Terraria.ModLoader.ItemLoader.HookCanEquipAccessory = AddHook<Func<Item, Player, int, bool>>(g => g.CanEquipAccessory)
staticprivate

Definition at line 1602 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.CanEquipAccessory().

◆ HookCanHitNPC

HookList Terraria.ModLoader.ItemLoader.HookCanHitNPC = AddHook<Func<Item, Player, NPC, bool?>>(g => g.CanHitNPC)
staticprivate

Definition at line 657 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.CanHitNPC().

◆ HookCanHitPvp

HookList Terraria.ModLoader.ItemLoader.HookCanHitPvp = AddHook<Func<Item, Player, Player, bool>>(g => g.CanHitPvp)
staticprivate

Definition at line 714 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.CanHitPvp().

◆ HookCanPickup

HookList Terraria.ModLoader.ItemLoader.HookCanPickup = AddHook<Func<Item, Player, bool>>(g => g.CanPickup)
staticprivate

Definition at line 1440 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.CanPickup().

◆ HookCanRightClick

HookList Terraria.ModLoader.ItemLoader.HookCanRightClick = AddHook<Func<Item, bool>>(g => g.CanRightClick)
staticprivate

Definition at line 1032 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.CanRightClick().

◆ HookCanUseItem

HookList Terraria.ModLoader.ItemLoader.HookCanUseItem = AddHook<Func<Item, Player, bool>>(g => g.CanUseItem)
staticprivate

Definition at line 300 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.CanUseItem().

◆ HookCaughtFishStack

HookList Terraria.ModLoader.ItemLoader.HookCaughtFishStack = AddHook<DelegateCaughtFishStack>(g => g.CaughtFishStack)
staticprivate

Definition at line 1640 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.CaughtFishStack().

◆ HookChoosePrefix

HookList Terraria.ModLoader.ItemLoader.HookChoosePrefix = AddHook<Func<Item, UnifiedRandom, int>>(g => g.ChoosePrefix)
staticprivate

Definition at line 248 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ChoosePrefix().

◆ HookConsumeAmmo

HookList Terraria.ModLoader.ItemLoader.HookConsumeAmmo = AddHook<Func<Item, Player, bool>>(g => g.ConsumeAmmo)
staticprivate

Definition at line 563 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ConsumeAmmo().

◆ HookConsumeItem

HookList Terraria.ModLoader.ItemLoader.HookConsumeItem = AddHook<Func<Item, Player, bool>>(g => g.ConsumeItem)
staticprivate

Definition at line 774 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ConsumeItem().

◆ HookDrawArmorColor

HookList Terraria.ModLoader.ItemLoader.HookDrawArmorColor = AddHook<DelegateDrawArmorColor>(g => g.DrawArmorColor)
staticprivate

Definition at line 1258 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.DrawArmorColor().

◆ HookDrawBody

HookList Terraria.ModLoader.ItemLoader.HookDrawBody = AddHook<Func<int, bool>>(g => g.DrawBody)
staticprivate

Definition at line 1221 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.DrawBody().

◆ HookDrawHair

HookList Terraria.ModLoader.ItemLoader.HookDrawHair = AddHook<DelegateDrawHair>(g => g.DrawHair)
staticprivate

Definition at line 1186 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.DrawHair().

◆ HookDrawHands

HookList Terraria.ModLoader.ItemLoader.HookDrawHands = AddHook<DelegateDrawHands>(g => g.DrawHands)
staticprivate

Definition at line 1173 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.DrawHands().

◆ HookDrawHead

HookList Terraria.ModLoader.ItemLoader.HookDrawHead = AddHook<Func<int, bool>>(g => g.DrawHead)
staticprivate

Definition at line 1202 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.DrawHead().

◆ HookDrawLegs

HookList Terraria.ModLoader.ItemLoader.HookDrawLegs = AddHook<Func<int, int, bool>>(g => g.DrawLegs)
staticprivate

Definition at line 1237 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.DrawLegs().

◆ HookExtractinatorUse

HookList Terraria.ModLoader.ItemLoader.HookExtractinatorUse = AddHook<DelegateExtractinatorUse>(g => g.ExtractinatorUse)
staticprivate

Definition at line 1618 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ExtractinatorUse().

◆ HookGetAlpha

HookList Terraria.ModLoader.ItemLoader.HookGetAlpha = AddHook<Func<Item, Color, Color?>>(g => g.GetAlpha)
staticprivate

Definition at line 1476 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.GetAlpha().

◆ HookGetHealLife

HookList Terraria.ModLoader.ItemLoader.HookGetHealLife = AddHook<DelegateGetHealLife>(g => g.GetHealLife)
staticprivate

Definition at line 393 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.GetHealLife().

◆ HookGetHealMana

HookList Terraria.ModLoader.ItemLoader.HookGetHealMana = AddHook<DelegateGetHealMana>(g => g.GetHealMana)
staticprivate

Definition at line 408 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.GetHealMana().

◆ HookGetWeaponCrit

HookList Terraria.ModLoader.ItemLoader.HookGetWeaponCrit = AddHook<DelegateGetWeaponCrit>(g => g.GetWeaponCrit)
staticprivate

Definition at line 522 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.GetWeaponCrit().

◆ HookGetWeaponDamage

HookList Terraria.ModLoader.ItemLoader.HookGetWeaponDamage = AddHook<DelegateGetWeaponDamage>(g => g.GetWeaponDamage)
staticprivate

Definition at line 470 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.GetWeaponDamage().

◆ HookGetWeaponKnockback

HookList Terraria.ModLoader.ItemLoader.HookGetWeaponKnockback = AddHook<DelegateGetWeaponKnockback>(g => g.GetWeaponKnockback)
staticprivate

Definition at line 506 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.GetWeaponKnockback().

◆ HookGrabRange

HookList Terraria.ModLoader.ItemLoader.HookGrabRange = AddHook<DelegateGrabRange>(g => g.GrabRange)
staticprivate

Definition at line 1413 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.GrabRange().

◆ HookGrabStyle

HookList Terraria.ModLoader.ItemLoader.HookGrabStyle = AddHook<Func<Item, Player, bool>>(g => g.GrabStyle)
staticprivate

Definition at line 1426 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.GrabStyle().

◆ HookHoldItem

HookList Terraria.ModLoader.ItemLoader.HookHoldItem = AddHook<Action<Item, Player>>(g => g.HoldItem)
staticprivate

Definition at line 351 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.HoldItem().

◆ HookHoldItemFrame

HookList Terraria.ModLoader.ItemLoader.HookHoldItemFrame = AddHook<Func<Item, Player, bool>>(g => g.HoldItemFrame)
staticprivate

Definition at line 824 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.HoldItemFrame().

◆ HookHoldoutOffset

HookList Terraria.ModLoader.ItemLoader.HookHoldoutOffset = AddHook<Func<int, Vector2?>>(g => g.HoldoutOffset)
staticprivate

Definition at line 1562 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.HoldoutOffset().

◆ HookHoldoutOrigin

HookList Terraria.ModLoader.ItemLoader.HookHoldoutOrigin = AddHook<Func<int, Vector2?>>(g => g.HoldoutOrigin)
staticprivate

Definition at line 1581 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.HoldoutOrigin().

◆ HookHoldStyle

HookList Terraria.ModLoader.ItemLoader.HookHoldStyle = AddHook<Action<Item, Player>>(g => g.HoldStyle)
staticprivate

Definition at line 336 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.HoldStyle().

◆ HookHorizontalWingSpeeds

HookList Terraria.ModLoader.ItemLoader.HookHorizontalWingSpeeds = AddHook<DelegateHorizontalWingSpeeds>(g => g.HorizontalWingSpeeds)
staticprivate

Definition at line 1337 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.HorizontalWingSpeeds().

◆ HookIsAnglerQuestAvailable

HookList Terraria.ModLoader.ItemLoader.HookIsAnglerQuestAvailable = AddHook<Func<int, bool>>(g => g.IsAnglerQuestAvailable)
staticprivate

◆ HookItemSpace

HookList Terraria.ModLoader.ItemLoader.HookItemSpace = AddHook<Func<Item, Player, bool>>(g => g.ItemSpace)
staticprivate

Definition at line 1465 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ItemSpace().

◆ HookMeleeEffects

HookList Terraria.ModLoader.ItemLoader.HookMeleeEffects = AddHook<Action<Item, Player, Rectangle>>(g => g.MeleeEffects)
staticprivate

Definition at line 644 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.MeleeEffects().

◆ HookMeleeSpeedMultiplier

HookList Terraria.ModLoader.ItemLoader.HookMeleeSpeedMultiplier = AddHook<Func<Item, Player, float>>(g => g.MeleeSpeedMultiplier)
staticprivate

Definition at line 379 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.MeleeSpeedMultiplier().

◆ HookModifyHitNPC

HookList Terraria.ModLoader.ItemLoader.HookModifyHitNPC = AddHook<DelegateModifyHitNPC>(g => g.ModifyHitNPC)
staticprivate

Definition at line 688 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ModifyHitNPC().

◆ HookModifyHitPvp

HookList Terraria.ModLoader.ItemLoader.HookModifyHitPvp = AddHook<DelegateModifyHitPvp>(g => g.ModifyHitPvp)
staticprivate

Definition at line 729 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ModifyHitPvp().

◆ HookModifyManaCost

HookList Terraria.ModLoader.ItemLoader.HookModifyManaCost = AddHook<DelegateModifyManaCost>(g => g.ModifyManaCost)
staticprivate

Definition at line 423 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ModifyManaCost().

◆ HookModifyTooltips

HookList Terraria.ModLoader.ItemLoader.HookModifyTooltips = AddHook<Action<Item, List<TooltipLine>>>(g => g.ModifyTooltips)
staticprivate

Definition at line 1717 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ModifyTooltips().

◆ HookModifyWeaponDamage

HookList Terraria.ModLoader.ItemLoader.HookModifyWeaponDamage = AddHook<DelegateModifyWeaponDamage>(g => g.ModifyWeaponDamage)
staticprivate

Definition at line 488 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ModifyWeaponDamage().

◆ HookModifyWeaponDamageOld

HookList Terraria.ModLoader.ItemLoader.HookModifyWeaponDamageOld = AddHook<DelegateModifyWeaponDamage>(g => g.ModifyWeaponDamage)
staticprivate

Definition at line 486 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ModifyWeaponDamage().

◆ HookNeedsSaving

HookList Terraria.ModLoader.ItemLoader.HookNeedsSaving = AddHook<Func<Item, bool>>(g => g.NeedsSaving)
staticprivate

Definition at line 1753 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.NeedsModSaving().

◆ HookOldPickAmmo

HookList Terraria.ModLoader.ItemLoader.HookOldPickAmmo = AddHook<DelegateOldPickAmmo>(g => g.PickAmmo)
staticprivate

Definition at line 544 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PickAmmo().

◆ HookOnConsumeAmmo

HookList Terraria.ModLoader.ItemLoader.HookOnConsumeAmmo = AddHook<Action<Item, Player>>(g => g.OnConsumeAmmo)
staticprivate

Definition at line 583 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.OnConsumeAmmo().

◆ HookOnConsumeItem

HookList Terraria.ModLoader.ItemLoader.HookOnConsumeItem = AddHook<Action<Item, Player>>(g => g.OnConsumeItem)
staticprivate

Definition at line 793 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.OnConsumeItem().

◆ HookOnConsumeMana

HookList Terraria.ModLoader.ItemLoader.HookOnConsumeMana = AddHook<Action<Item, Player, int>>(g => g.OnConsumeMana)
staticprivate

Definition at line 453 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.OnConsumeMana().

◆ HookOnCraft

HookList Terraria.ModLoader.ItemLoader.HookOnCraft = AddHook<Action<Item, Recipe>>(g => g.OnCraft)
staticprivate

Definition at line 1674 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.OnCraft().

◆ HookOnHitNPC

HookList Terraria.ModLoader.ItemLoader.HookOnHitNPC = AddHook<Action<Item, Player, NPC, int, float, bool>>(g => g.OnHitNPC)
staticprivate

Definition at line 701 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.OnHitNPC().

◆ HookOnHitPvp

HookList Terraria.ModLoader.ItemLoader.HookOnHitPvp = AddHook<Action<Item, Player, Player, int, bool>>(g => g.OnHitPvp)
staticprivate

Definition at line 742 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.OnHitPvp().

◆ HookOnMissingMana

HookList Terraria.ModLoader.ItemLoader.HookOnMissingMana = AddHook<Action<Item, Player, int>>(g => g.OnMissingMana)
staticprivate

Definition at line 438 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.OnMissingMana().

◆ HookOnPickup

HookList Terraria.ModLoader.ItemLoader.HookOnPickup = AddHook<Func<Item, Player, bool>>(g => g.OnPickup)
staticprivate

Definition at line 1451 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.OnPickup().

◆ HookOpenVanillaBag

HookList Terraria.ModLoader.ItemLoader.HookOpenVanillaBag = AddHook<Action<string, Player, int>>(g => g.OpenVanillaBag)
staticprivate

Definition at line 1125 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.OpenVanillaBag().

◆ HookPickAmmo

HookList Terraria.ModLoader.ItemLoader.HookPickAmmo = AddHook<DelegatePickAmmo>(g => g.PickAmmo)
staticprivate

Definition at line 547 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PickAmmo().

◆ HookPostDrawInInventory

HookList Terraria.ModLoader.ItemLoader.HookPostDrawInInventory = AddHook<Action<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float>>(g => g.PostDrawInInventory)
staticprivate

Definition at line 1547 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PostDrawInInventory().

◆ HookPostDrawInWorld

HookList Terraria.ModLoader.ItemLoader.HookPostDrawInWorld = AddHook<Action<Item, SpriteBatch, Color, Color, float, float, int>>(g => g.PostDrawInWorld)
staticprivate

Definition at line 1515 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PostDrawInWorld().

◆ HookPostDrawTooltip

HookList Terraria.ModLoader.ItemLoader.HookPostDrawTooltip = AddHook<DelegatePostDrawTooltip>(g => g.PostDrawTooltip)
staticprivate

Definition at line 1692 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PostDrawTooltip().

◆ HookPostDrawTooltipLine

HookList Terraria.ModLoader.ItemLoader.HookPostDrawTooltipLine = AddHook<DelegatePostDrawTooltipLine>(g => g.PostDrawTooltipLine)
staticprivate

Definition at line 1710 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PostDrawTooltipLine().

◆ HookPostReforge

HookList Terraria.ModLoader.ItemLoader.HookPostReforge = AddHook<Action<Item>>(g => g.PostReforge)
staticprivate

Definition at line 1162 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PostReforge().

◆ HookPostUpdate

HookList Terraria.ModLoader.ItemLoader.HookPostUpdate = AddHook<Action<Item>>(g => g.PostUpdate)
staticprivate

Definition at line 1401 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PostUpdate().

◆ HookPreDrawInInventory

HookList Terraria.ModLoader.ItemLoader.HookPreDrawInInventory = AddHook<Func<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float, bool>>(g => g.PreDrawInInventory)
staticprivate

Definition at line 1528 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PreDrawInInventory().

◆ HookPreDrawInWorld

HookList Terraria.ModLoader.ItemLoader.HookPreDrawInWorld = AddHook<DelegatePreDrawInWorld>(g => g.PreDrawInWorld)
staticprivate

Definition at line 1498 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PreDrawInWorld().

◆ HookPreDrawTooltip

HookList Terraria.ModLoader.ItemLoader.HookPreDrawTooltip = AddHook<DelegatePreDrawTooltip>(g => g.PreDrawTooltip)
staticprivate

Definition at line 1682 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PreDrawTooltip().

◆ HookPreDrawTooltipLine

HookList Terraria.ModLoader.ItemLoader.HookPreDrawTooltipLine = AddHook<DelegatePreDrawTooltipLine>(g => g.PreDrawTooltipLine)
staticprivate

Definition at line 1700 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PreDrawTooltipLine().

◆ HookPrefixChance

HookList Terraria.ModLoader.ItemLoader.HookPrefixChance = AddHook<Func<Item, int, UnifiedRandom, bool?>>(g => g.PrefixChance)
staticprivate

Definition at line 266 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PrefixChance().

◆ HookPreOpenVanillaBag

HookList Terraria.ModLoader.ItemLoader.HookPreOpenVanillaBag = AddHook<Func<string, Player, int, bool>>(g => g.PreOpenVanillaBag)
staticprivate

Definition at line 1104 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PreOpenVanillaBag().

◆ HookPreReforge

HookList Terraria.ModLoader.ItemLoader.HookPreReforge = AddHook<Func<Item, bool>>(g => g.NewPreReforge)
staticprivate

Definition at line 1151 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PreReforge().

◆ HookPreUpdateVanitySet

HookList Terraria.ModLoader.ItemLoader.HookPreUpdateVanitySet = AddHook<Action<Player, string>>(g => g.PreUpdateVanitySet)
staticprivate

Definition at line 943 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.PreUpdateVanitySet().

◆ HookReforgePrice

HookList Terraria.ModLoader.ItemLoader.HookReforgePrice = AddHook<DelegateReforgePrice>(g => g.ReforgePrice)
staticprivate

Definition at line 1137 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.ReforgePrice().

◆ HookRightClick

HookList Terraria.ModLoader.ItemLoader.HookRightClick = AddHook<Action<Item, Player>>(g => g.RightClick)
staticprivate

Definition at line 1052 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.RightClick().

◆ hooks

List<HookList> Terraria.ModLoader.ItemLoader.hooks = new List<HookList>()
staticprivate

Definition at line 44 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.AddHook< F >().

◆ HookSetDefaults

HookList Terraria.ModLoader.ItemLoader.HookSetDefaults = AddHook<Action<Item>>(g => g.SetDefaults)
staticprivate

Definition at line 194 of file ItemLoader.cs.

◆ HookSetMatch

HookList Terraria.ModLoader.ItemLoader.HookSetMatch = AddHook<DelegateSetMatch>(g => g.SetMatch)
staticprivate

Definition at line 1020 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.SetMatch().

◆ HookShoot

HookList Terraria.ModLoader.ItemLoader.HookShoot = AddHook<DelegateShoot>(g => g.Shoot)
staticprivate

Definition at line 601 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.Shoot().

◆ HookUpdate

HookList Terraria.ModLoader.ItemLoader.HookUpdate = AddHook<DelegateUpdate>(g => g.Update)
staticprivate

Definition at line 1375 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.Update().

◆ HookUpdateAccessory

HookList Terraria.ModLoader.ItemLoader.HookUpdateAccessory = AddHook<Action<Item, Player, bool>>(g => g.UpdateAccessory)
staticprivate

Definition at line 894 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.UpdateAccessory().

◆ HookUpdateArmorSet

HookList Terraria.ModLoader.ItemLoader.HookUpdateArmorSet = AddHook<Action<Player, string>>(g => g.UpdateArmorSet)
staticprivate

Definition at line 921 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.UpdateArmorSet().

◆ HookUpdateEquip

HookList Terraria.ModLoader.ItemLoader.HookUpdateEquip = AddHook<Action<Item, Player>>(g => g.UpdateEquip)
staticprivate

Definition at line 878 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.UpdateEquip().

◆ HookUpdateInventory

HookList Terraria.ModLoader.ItemLoader.HookUpdateInventory = AddHook<Action<Item, Player>>(g => g.UpdateInventory)
staticprivate

Definition at line 862 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.UpdateInventory().

◆ HookUpdateVanitySet

HookList Terraria.ModLoader.ItemLoader.HookUpdateVanitySet = AddHook<Action<Player, string>>(g => g.UpdateVanitySet)
staticprivate

Definition at line 968 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.UpdateVanitySet().

◆ HookUseItem

HookList Terraria.ModLoader.ItemLoader.HookUseItem = AddHook<Func<Item, Player, bool>>(g => g.UseItem)
staticprivate

Definition at line 755 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.UseItem().

◆ HookUseItemFrame

HookList Terraria.ModLoader.ItemLoader.HookUseItemFrame = AddHook<Func<Item, Player, bool>>(g => g.UseItemFrame)
staticprivate

Definition at line 807 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.UseItemFrame().

◆ HookUseItemHitbox

HookList Terraria.ModLoader.ItemLoader.HookUseItemHitbox = AddHook<DelegateUseItemHitbox>(g => g.UseItemHitbox)
staticprivate

Definition at line 631 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.UseItemHitbox().

◆ HookUseStyle

HookList Terraria.ModLoader.ItemLoader.HookUseStyle = AddHook<Action<Item, Player>>(g => g.UseStyle)
staticprivate

Definition at line 321 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.UseStyle().

◆ HookUseTimeMultiplier

HookList Terraria.ModLoader.ItemLoader.HookUseTimeMultiplier = AddHook<Func<Item, Player, float>>(g => g.UseTimeMultiplier)
staticprivate

Definition at line 366 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.UseTimeMultiplier().

◆ HookVerticalWingSpeeds

HookList Terraria.ModLoader.ItemLoader.HookVerticalWingSpeeds = AddHook<DelegateVerticalWingSpeeds>(g => g.VerticalWingSpeeds)
staticprivate

Definition at line 1311 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.VerticalWingSpeeds().

◆ HookWingUpdate

HookList Terraria.ModLoader.ItemLoader.HookWingUpdate = AddHook<Func<int, Player, bool, bool>>(g => g.WingUpdate)
staticprivate

Definition at line 1357 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.ItemLoader.WingUpdate().

◆ nextItem

int Terraria.ModLoader.ItemLoader.nextItem = ItemID.Count
staticprivate

Definition at line 23 of file ItemLoader.cs.

Property Documentation

◆ ItemCount