Terraria ModLoader  0.11.5
A framework for 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 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...
 

Static Public Attributes

static int ItemCount => nextItem
 

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 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

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
static bool Terraria.ModLoader.ItemLoader.AllowPrefix ( Item  item,
int  pre 
)
static

Definition at line 285 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

285  {
286  bool result = true;
287  foreach (var g in HookAllowPrefix.arr) {
288  result &= g.Instance(item).AllowPrefix(item, pre);
289  }
290  if (item.modItem != null) {
291  result &= item.modItem.AllowPrefix(pre);
292  }
293  return result;
294  }
static HookList HookAllowPrefix
Definition: ItemLoader.cs:284
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 844 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

844  {
845  if (item.IsAir)
846  return false;
847 
848  if (item.modItem != null && item.modItem.AltFunctionUse(player))
849  return true;
850 
851  foreach (var g in HookAltFunctionUse.arr)
852  if (g.Instance(item).AltFunctionUse(item, player))
853  return true;
854 
855  return false;
856  }
static HookList HookAltFunctionUse
Definition: ItemLoader.cs:840
static string Terraria.ModLoader.ItemLoader.AnglerChat ( int  type)
static

Definition at line 1643 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1643  {
1644  string chat = "";
1645  string catchLocation = "";
1646  GetItem(type)?.AnglerQuestChat(ref chat, ref catchLocation);
1647 
1648  foreach (var g in HookAnglerChat.arr)
1649  g.AnglerChat(type, ref chat, ref catchLocation);
1650 
1651  if (string.IsNullOrEmpty(chat) || string.IsNullOrEmpty(catchLocation))
1652  return null;
1653 
1654  return chat + "\n\n(" + catchLocation + ")";
1655  }
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:1642
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:986
static Rectangle Terraria.ModLoader.ItemLoader.AnimatedItemFrame ( Item  item)
staticprivate

Definition at line 241 of file ItemLoader.cs.

241  {
242  int frameCount = Main.itemAnimations[item.type].FrameCount;
243  int frameDuration = Main.itemAnimations[item.type].TicksPerFrame;
244  return Main.itemAnimations[item.type].GetFrame(Main.itemTexture[item.type]);
245  }
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 1272 of file ItemLoader.cs.

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

1272  {
1273  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, slot);
1274  texture?.ArmorArmGlowMask(drawPlayer, shadow, ref glowMask, ref color);
1275 
1276  foreach (var g in HookArmorArmGlowMask.arr)
1277  g.ArmorArmGlowMask(slot, drawPlayer, shadow, ref glowMask, ref color);
1278  }
static HookList HookArmorArmGlowMask
Definition: ItemLoader.cs:1268
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:6

+ Here is the call graph for this function:

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 995 of file ItemLoader.cs.

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

995  {
996  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
997  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
998  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
999  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
1000  headTexture.ArmorSetShadows(player);
1001 
1002  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
1003  bodyTexture.ArmorSetShadows(player);
1004 
1005  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
1006  legTexture.ArmorSetShadows(player);
1007 
1008  foreach (GlobalItem globalItem in HookArmorSetShadows.arr) {
1009  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
1010  if (!string.IsNullOrEmpty(set))
1011  globalItem.ArmorSetShadows(player, set);
1012  }
1013  }
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:6
static HookList HookArmorSetShadows
Definition: ItemLoader.cs:989

+ Here is the call graph for this function:

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

Definition at line 1609 of file ItemLoader.cs.

1609  {
1610  if (item.modItem != null) {
1611  item.modItem.AutoLightSelect(ref dryTorch, ref wetTorch, ref glowstick);
1612  if (wetTorch) {
1613  dryTorch = false;
1614  glowstick = false;
1615  }
1616  if (dryTorch) {
1617  glowstick = false;
1618  }
1619  }
1620  }
static bool Terraria.ModLoader.ItemLoader.CanEquipAccessory ( Item  item,
int  slot 
)
static

Definition at line 1588 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1588  {
1589  Player player = Main.player[Main.myPlayer];
1590  if (item.modItem != null && !item.modItem.CanEquipAccessory(player, slot))
1591  return false;
1592 
1593  foreach (var g in HookCanEquipAccessory.arr)
1594  if (!g.Instance(item).CanEquipAccessory(item, player, slot))
1595  return false;
1596 
1597  return true;
1598  }
static HookList HookCanEquipAccessory
Definition: ItemLoader.cs:1585
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 664 of file ItemLoader.cs.

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

664  {
665  bool? canHit = item.modItem?.CanHitNPC(player, target);
666  if (canHit.HasValue && !canHit.Value) {
667  return false;
668  }
669  foreach (var g in HookCanHitNPC.arr) {
670  bool? globalCanHit = g.Instance(item).CanHitNPC(item, player, target);
671  if (globalCanHit.HasValue) {
672  if (globalCanHit.Value) {
673  canHit = true;
674  }
675  else {
676  return false;
677  }
678  }
679  }
680  return canHit;
681  }
static HookList HookCanHitNPC
Definition: ItemLoader.cs:653
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 716 of file ItemLoader.cs.

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

716  {
717  foreach (var g in HookCanHitPvp.arr)
718  if (!g.Instance(item).CanHitPvp(item, player, target))
719  return false;
720 
721  return item.modItem == null || item.modItem.CanHitPvp(player, target);
722  }
static HookList HookCanHitPvp
Definition: ItemLoader.cs:710
static bool Terraria.ModLoader.ItemLoader.CanPickup ( Item  item,
Player  player 
)
static

Definition at line 1426 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1426  {
1427  foreach (var g in HookCanPickup.arr)
1428  if (!g.Instance(item).CanPickup(item, player))
1429  return false;
1430 
1431  return item.modItem?.CanPickup(player) ?? true;
1432  }
static HookList HookCanPickup
Definition: ItemLoader.cs:1423
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 1034 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1034  {
1035  if (item.IsAir || !Main.mouseRight)
1036  return false;
1037 
1038  if (item.modItem != null && item.modItem.CanRightClick())
1039  return true;
1040 
1041  foreach (var g in HookCanRightClick.arr)
1042  if (g.Instance(item).CanRightClick(item))
1043  return true;
1044 
1045  return false;
1046  }
static HookList HookCanRightClick
Definition: ItemLoader.cs:1028
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 306 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

306  {
307  bool flag = true;
308  if (item.modItem != null)
309  flag &= item.modItem.CanUseItem(player);
310 
311  foreach (var g in HookCanUseItem.arr)
312  flag &= g.Instance(item).CanUseItem(item, player);
313 
314  return flag;
315  }
static HookList HookCanUseItem
Definition: ItemLoader.cs:296
static void Terraria.ModLoader.ItemLoader.CaughtFishStack ( Item  item)
static

Definition at line 1624 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1624  {
1625  item.modItem?.CaughtFishStack(ref item.stack);
1626 
1627  foreach (var g in HookCaughtFishStack.arr)
1628  g.Instance(item).CaughtFishStack(item.type, ref item.stack);
1629  }
static HookList HookCaughtFishStack
Definition: ItemLoader.cs:1623
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 535 of file ItemLoader.cs.

References Terraria.ModLoader.Item.

535  {
536  return item.modItem == null || !item.modItem.OnlyShootOnSwing || player.itemAnimation == player.itemAnimationMax - 1;
537  }
static int Terraria.ModLoader.ItemLoader.ChoosePrefix ( Item  item,
UnifiedRandom  rand 
)
static

Definition at line 249 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

249  {
250  foreach (var g in HookChoosePrefix.arr) {
251  int pre = g.Instance(item).ChoosePrefix(item, rand);
252  if (pre >= 0) {
253  return pre;
254  }
255  }
256  if (item.modItem != null) {
257  return item.modItem.ChoosePrefix(rand);
258  }
259  return -1;
260  }
static HookList HookChoosePrefix
Definition: ItemLoader.cs:247
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 565 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

565  {
566  if (item.modItem != null && !item.modItem.ConsumeAmmo(player) ||
567  ammo.modItem != null && !ammo.modItem.ConsumeAmmo(player))
568  return false;
569 
570  foreach (var g in HookConsumeAmmo.arr) {
571  if (!g.Instance(item).ConsumeAmmo(item, player) ||
572  !g.Instance(ammo).ConsumeAmmo(ammo, player))
573  return false;
574  }
575 
576  return true;
577  }
static HookList HookConsumeAmmo
Definition: ItemLoader.cs:559
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 776 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

776  {
777  if (item.IsAir) return true;
778  if (item.modItem != null && !item.modItem.ConsumeItem(player))
779  return false;
780 
781  foreach (var g in HookConsumeItem.arr)
782  if (!g.Instance(item).ConsumeItem(item, player))
783  return false;
784 
785  OnConsumeItem(item, player);
786  return true;
787  }
static void OnConsumeItem(Item item, Player player)
Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.
Definition: ItemLoader.cs:793
static HookList HookConsumeItem
Definition: ItemLoader.cs:770
delegate void Terraria.ModLoader.ItemLoader.DelegateAnglerChat ( int  type,
ref string  chat,
ref string  catchLocation 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateArmorArmGlowMask ( int  slot,
Player  drawPlayer,
float  shadow,
ref int  glowMask,
ref Color  color 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateCaughtFishStack ( int  type,
ref int  stack 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateDrawArmorColor ( EquipType  type,
int  slot,
Player  drawPlayer,
float  shadow,
ref Color  color,
ref int  glowMask,
ref Color  glowMaskColor 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateDrawHair ( int  body,
ref bool  drawHair,
ref bool  drawAltHair 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateDrawHands ( int  body,
ref bool  drawHands,
ref bool  drawArms 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateExtractinatorUse ( int  extractType,
ref int  resultType,
ref int  resultStack 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetHealLife ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetHealMana ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponCrit ( Item  item,
Player  player,
ref int  crit 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponDamage ( Item  item,
Player  player,
ref int  damage 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponKnockback ( Item  item,
Player  player,
ref float  knockback 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGrabRange ( Item  item,
Player  player,
ref int  grabRange 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateHorizontalWingSpeeds ( Item  item,
Player  player,
ref float  speed,
ref float  acceleration 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyHitNPC ( Item  item,
Player  player,
NPC  target,
ref int  damage,
ref float  knockBack,
ref bool  crit 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyHitPvp ( Item  item,
Player  player,
Player  target,
ref int  damage,
ref bool  crit 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyManaCost ( Item  item,
Player  player,
ref float  reduce,
ref float  mult 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyWeaponDamage ( Item  item,
Player  player,
ref float  add,
ref float  mult,
ref float  flat 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyWeaponDamageOld ( Item  item,
Player  player,
ref float  add,
ref float  mult 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateOldPickAmmo ( Item  item,
Player  player,
ref int  type,
ref float  speed,
ref int  damage,
ref float  knockback 
)
private
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
delegate void Terraria.ModLoader.ItemLoader.DelegatePostDrawTooltip ( Item  item,
ReadOnlyCollection< DrawableTooltipLine lines 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegatePostDrawTooltipLine ( Item  item,
DrawableTooltipLine  line 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawInWorld ( Item  item,
SpriteBatch  spriteBatch,
Color  lightColor,
Color  alphaColor,
ref float  rotation,
ref float  scale,
int  whoAmI 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawTooltip ( Item  item,
ReadOnlyCollection< TooltipLine lines,
ref int  x,
ref int  y 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawTooltipLine ( Item  item,
DrawableTooltipLine  line,
ref int  yOffset 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegateReforgePrice ( Item  item,
ref int  reforgePrice,
ref bool  canApplyDiscount 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateSetMatch ( int  armorSlot,
int  type,
bool  male,
ref int  equipSlot,
ref bool  robes 
)
private
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
delegate void Terraria.ModLoader.ItemLoader.DelegateUpdate ( Item  item,
ref float  gravity,
ref float  maxFallSpeed 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateUseItemHitbox ( Item  item,
Player  player,
ref Rectangle  hitbox,
ref bool  noHitbox 
)
private
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
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 1258 of file ItemLoader.cs.

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

1259  {
1260  EquipTexture texture = EquipLoader.GetEquipTexture(type, slot);
1261  texture?.DrawArmorColor(drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
1262 
1263  foreach (var g in HookDrawArmorColor.arr)
1264  g.DrawArmorColor(type, slot, drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
1265  }
static HookList HookDrawArmorColor
Definition: ItemLoader.cs:1254

+ Here is the call graph for this function:

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 1221 of file ItemLoader.cs.

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

1221  {
1222  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1223  if (texture != null && !texture.DrawBody())
1224  return false;
1225 
1226  foreach (var g in HookDrawBody.arr)
1227  if (!g.DrawBody(player.body))
1228  return false;
1229 
1230  return true;
1231  }
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:6
static HookList HookDrawBody
Definition: ItemLoader.cs:1217

+ Here is the call graph for this function:

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 1190 of file ItemLoader.cs.

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

1190  {
1191  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1192  texture?.DrawHair(ref drawHair, ref drawAltHair);
1193 
1194  foreach (var g in HookDrawHair.arr)
1195  g.DrawHair(player.body, ref drawHair, ref drawAltHair);
1196  }
static HookList HookDrawHair
Definition: ItemLoader.cs:1182
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:6

+ Here is the call graph for this function:

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 1173 of file ItemLoader.cs.

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

1173  {
1174  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1175  texture?.DrawHands(ref drawHands, ref drawArms);
1176 
1177  foreach (var g in HookDrawHands.arr)
1178  g.DrawHands(player.body, ref drawHands, ref drawArms);
1179  }
static HookList HookDrawHands
Definition: ItemLoader.cs:1169
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:6

+ Here is the call graph for this function:

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 1205 of file ItemLoader.cs.

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

1205  {
1206  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1207  if (texture != null && !texture.DrawHead())
1208  return false;
1209 
1210  foreach (var g in HookDrawHead.arr)
1211  if (!g.DrawHead(player.head))
1212  return false;
1213 
1214  return true;
1215  }
static HookList HookDrawHead
Definition: ItemLoader.cs:1198
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:6

+ Here is the call graph for this function:

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 1237 of file ItemLoader.cs.

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

1237  {
1238  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
1239  if (texture != null && !texture.DrawLegs())
1240  return false;
1241 
1242  texture = EquipLoader.GetEquipTexture(EquipType.Shoes, player.shoe);
1243  if (texture != null && !texture.DrawLegs())
1244  return false;
1245 
1246  foreach (var g in HookDrawLegs.arr)
1247  if (!g.DrawLegs(player.legs, player.shoe))
1248  return false;
1249 
1250  return true;
1251  }
static HookList HookDrawLegs
Definition: ItemLoader.cs:1233
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:6

+ Here is the call graph for this function:

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

Definition at line 1602 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1602  {
1603  GetItem(extractType)?.ExtractinatorUse(ref resultType, ref resultStack);
1604 
1605  foreach (var g in HookExtractinatorUse.arr)
1606  g.ExtractinatorUse(extractType, ref resultType, ref resultStack);
1607  }
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
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:948
static HookList HookExtractinatorUse
Definition: ItemLoader.cs:1601
static void Terraria.ModLoader.ItemLoader.FindVanillaWings ( )
staticprivate

Definition at line 52 of file ItemLoader.cs.

References Terraria.ModLoader.ModNet.AllowVanillaClients, and Terraria.ModLoader.Item.

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  }
static bool Terraria.ModLoader.ItemLoader.GeneralPrefix ( Item  item)
staticprivate

Definition at line 173 of file ItemLoader.cs.

References Terraria.ModLoader.Item.

173  {
174  return item.maxStack == 1 && item.damage > 0 && item.ammo == 0 && !item.accessory;
175  }
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 1467 of file ItemLoader.cs.

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

1467  {
1468  if (item.IsAir)
1469  return null;
1470 
1471  foreach (var g in HookGetAlpha.arr) {
1472  Color? color = g.Instance(item).GetAlpha(item, lightColor);
1473  if (color.HasValue)
1474  return color;
1475  }
1476 
1477  return item.modItem?.GetAlpha(lightColor);
1478  }
static HookList HookGetAlpha
Definition: ItemLoader.cs:1459
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 393 of file ItemLoader.cs.

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

393  {
394  if (item.IsAir)
395  return;
396 
397  item.modItem?.GetHealLife(player, quickHeal, ref healValue);
398 
399  foreach (var g in HookGetHealLife.arr)
400  g.Instance(item).GetHealLife(item, player, quickHeal, ref healValue);
401  }
static HookList HookGetHealLife
Definition: ItemLoader.cs:389
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 408 of file ItemLoader.cs.

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

408  {
409  if (item.IsAir)
410  return;
411 
412  item.modItem?.GetHealMana(player, quickHeal, ref healValue);
413 
414  foreach (var g in HookGetHealMana.arr)
415  g.Instance(item).GetHealMana(item, player, quickHeal, ref healValue);
416  }
static HookList HookGetHealMana
Definition: ItemLoader.cs:404
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.

Referenced by Terraria.ModLoader.Mod.AddMusicBox(), and Terraria.ModLoader.ModContent.MusicExists().

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

+ Here is the caller graph for this function:

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 522 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

522  {
523  if (item.IsAir)
524  return;
525 
526  item.modItem?.GetWeaponCrit(player, ref crit);
527 
528  foreach (var g in HookGetWeaponCrit.arr)
529  g.Instance(item).GetWeaponCrit(item, player, ref crit);
530  }
static HookList HookGetWeaponCrit
Definition: ItemLoader.cs:518
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 471 of file ItemLoader.cs.

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

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

471  {
472  if (item.IsAir)
473  return;
474 
475  item.modItem?.GetWeaponDamage(player, ref damage);
476 
477  foreach (var g in HookGetWeaponDamage.arr)
478  g.Instance(item).GetWeaponDamage(item, player, ref damage);
479  }
static HookList HookGetWeaponDamage
Definition: ItemLoader.cs:466

+ Here is the caller graph for this function:

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 506 of file ItemLoader.cs.

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

506  {
507  if (item.IsAir)
508  return;
509 
510  item.modItem?.GetWeaponKnockback(player, ref knockback);
511 
512  foreach (var g in HookGetWeaponKnockback.arr)
513  g.Instance(item).GetWeaponKnockback(item, player, ref knockback);
514  }
static HookList HookGetWeaponKnockback
Definition: ItemLoader.cs:502
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 1283 of file ItemLoader.cs.

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

1283  {
1284  Item item = null;
1285  for (int k = 3; k < 8 + player.extraAccessorySlots; k++) {
1286  if (player.armor[k].wingSlot == player.wingsLogic) {
1287  item = player.armor[k];
1288  }
1289  }
1290  if (item != null) {
1291  return item;
1292  }
1293  if (player.wingsLogic > 0 && player.wingsLogic < Main.maxWings) {
1294  item = new Item();
1295  item.SetDefaults(vanillaWings[player.wingsLogic]);
1296  return item;
1297  }
1298  if (player.wingsLogic >= Main.maxWings) {
1299  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1300  if (texture?.item != null)
1301  return texture.item.item;
1302  }
1303  return null;
1304  }
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:6

+ Here is the call graph for this function:

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 1402 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1402  {
1403  item.modItem?.GrabRange(player, ref grabRange);
1404 
1405  foreach (var g in HookGrabRange.arr)
1406  g.Instance(item).GrabRange(item, player, ref grabRange);
1407  }
static HookList HookGrabRange
Definition: ItemLoader.cs:1396
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 1415 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1415  {
1416  foreach (var g in HookGrabStyle.arr)
1417  if (g.Instance(item).GrabStyle(item, player))
1418  return true;
1419 
1420  return item.modItem != null && item.modItem.GrabStyle(player);
1421  }
static HookList HookGrabStyle
Definition: ItemLoader.cs:1409
static bool Terraria.ModLoader.ItemLoader.HasMethod ( Type  t,
string  method,
params Type[]  args 
)
staticprivate

Definition at line 1756 of file ItemLoader.cs.

References Terraria.ModLoader.GlobalItem.CloneNewInstances, Terraria.ModLoader.GlobalItem.InstancePerEntity, and Terraria.ModLoader.Item.

1756  {
1757  return t.GetMethod(method, args).DeclaringType != typeof(GlobalItem);
1758  }
static void Terraria.ModLoader.ItemLoader.HoldItem ( Item  item,
Player  player 
)
static

Calls ModItem.HoldItem and all GlobalItem.HoldItem hooks.

Definition at line 352 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

352  {
353  if (item.IsAir)
354  return;
355 
356  item.modItem?.HoldItem(player);
357 
358  foreach (var g in HookHoldItem.arr)
359  g.Instance(item).HoldItem(item, player);
360  }
static HookList HookHoldItem
Definition: ItemLoader.cs:347
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 826 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

826  {
827  if (item.IsAir)
828  return false;
829 
830  if (item.modItem != null && item.modItem.HoldItemFrame(player))
831  return true;
832 
833  foreach (var g in HookHoldItemFrame.arr)
834  if (g.Instance(item).HoldItemFrame(item, player))
835  return true;
836 
837  return false;
838  }
static HookList HookHoldItemFrame
Definition: ItemLoader.cs:820
static void Terraria.ModLoader.ItemLoader.HoldoutOffset ( float  gravDir,
int  type,
ref Vector2  offset 
)
static

Definition at line 1546 of file ItemLoader.cs.

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

1546  {
1547  ModItem modItem = GetItem(type);
1548  if (modItem != null) {
1549  Vector2? modOffset = modItem.HoldoutOffset();
1550  if (modOffset.HasValue) {
1551  offset.X = modOffset.Value.X;
1552  offset.Y += gravDir * modOffset.Value.Y;
1553  }
1554  }
1555  foreach (var g in HookHoldoutOffset.arr) {
1556  Vector2? modOffset = g.HoldoutOffset(type);
1557  if (modOffset.HasValue) {
1558  offset.X = modOffset.Value.X;
1559  offset.Y = Main.itemTexture[type].Height / 2f + gravDir * modOffset.Value.Y;
1560  }
1561  }
1562  }
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 HookHoldoutOffset
Definition: ItemLoader.cs:1545

+ Here is the call graph for this function:

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

Definition at line 1565 of file ItemLoader.cs.

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

1565  {
1566  Item item = player.inventory[player.selectedItem];
1567  Vector2 modOrigin = Vector2.Zero;
1568  if (item.modItem != null) {
1569  Vector2? modOrigin2 = item.modItem.HoldoutOrigin();
1570  if (modOrigin2.HasValue) {
1571  modOrigin = modOrigin2.Value;
1572  }
1573  }
1574  foreach (var g in HookHoldoutOrigin.arr) {
1575  Vector2? modOrigin2 = g.Instance(item).HoldoutOrigin(item.type);
1576  if (modOrigin2.HasValue) {
1577  modOrigin = modOrigin2.Value;
1578  }
1579  }
1580  modOrigin.X *= player.direction;
1581  modOrigin.Y *= -player.gravDir;
1582  origin += modOrigin;
1583  }
static HookList HookHoldoutOrigin
Definition: ItemLoader.cs:1564
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 337 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

337  {
338  if (item.IsAir || player.pulley || player.itemAnimation > 0)
339  return;
340 
341  item.modItem?.HoldStyle(player);
342 
343  foreach (var g in HookHoldStyle.arr)
344  g.Instance(item).HoldStyle(item, player);
345  }
static HookList HookHoldStyle
Definition: ItemLoader.cs:332
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 1339 of file ItemLoader.cs.

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

1339  {
1340  Item item = GetWing(player);
1341  if (item == null) {
1342  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1343  texture?.HorizontalWingSpeeds(player, ref player.accRunSpeed, ref player.runAcceleration);
1344  return;
1345  }
1346 
1347  item.modItem?.HorizontalWingSpeeds(player, ref player.accRunSpeed, ref player.runAcceleration);
1348 
1349  foreach (var g in HookHorizontalWingSpeeds.arr)
1350  g.Instance(item).HorizontalWingSpeeds(item, player, ref player.accRunSpeed, ref player.runAcceleration);
1351  }
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:1283
static HookList HookHorizontalWingSpeeds
Definition: ItemLoader.cs:1333
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:6

+ Here is the call graph for this function:

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

Definition at line 1632 of file ItemLoader.cs.

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

1632  {
1633  ModItem modItem = GetItem(itemID);
1634  if (modItem != null)
1635  notAvailable |= !modItem.IsAnglerQuestAvailable();
1636 
1637  foreach (var g in HookIsAnglerQuestAvailable.arr)
1638  notAvailable |= !g.IsAnglerQuestAvailable(itemID);
1639  }
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 HookIsAnglerQuestAvailable
Definition: ItemLoader.cs:1631

+ Here is the call graph for this function:

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 1083 of file ItemLoader.cs.

1083  {
1084  return item.modItem != null && item.modItem.BossBagNPC > 0;
1085  }
static bool Terraria.ModLoader.ItemLoader.ItemSpace ( Item  item,
Player  player 
)
static

Definition at line 1451 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1451  {
1452  foreach (var g in HookItemSpace.arr)
1453  if (g.Instance(item).ItemSpace(item, player))
1454  return true;
1455 
1456  return item.modItem?.ItemSpace(player) ?? false;
1457  }
static HookList HookItemSpace
Definition: ItemLoader.cs:1448
static void Terraria.ModLoader.ItemLoader.MeleeEffects ( Item  item,
Player  player,
Rectangle  hitbox 
)
static

Calls ModItem.MeleeEffects and all GlobalItem.MeleeEffects hooks.

Definition at line 646 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

646  {
647  item.modItem?.MeleeEffects(player, hitbox);
648 
649  foreach (var g in HookMeleeEffects.arr)
650  g.Instance(item).MeleeEffects(item, player, hitbox);
651  }
static HookList HookMeleeEffects
Definition: ItemLoader.cs:640
static float Terraria.ModLoader.ItemLoader.MeleeSpeedMultiplier ( Item  item,
Player  player 
)
static

Definition at line 376 of file ItemLoader.cs.

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

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

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

+ Here is the caller graph for this function:

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 690 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

690  {
691  item.modItem?.ModifyHitNPC(player, target, ref damage, ref knockBack, ref crit);
692 
693  foreach (var g in HookModifyHitNPC.arr)
694  g.Instance(item).ModifyHitNPC(item, player, target, ref damage, ref knockBack, ref crit);
695  }
static HookList HookModifyHitNPC
Definition: ItemLoader.cs:684
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 731 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

731  {
732  item.modItem?.ModifyHitPvp(player, target, ref damage, ref crit);
733 
734  foreach (var g in HookModifyHitPvp.arr)
735  g.Instance(item).ModifyHitPvp(item, player, target, ref damage, ref crit);
736  }
static HookList HookModifyHitPvp
Definition: ItemLoader.cs:725
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 423 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

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

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

+ Here is the caller graph for this function:

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 1701 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.TooltipLine.isModifier, and Terraria.ModLoader.TooltipLine.isModifierBad.

1702  {
1703  List<TooltipLine> tooltips = new List<TooltipLine>();
1704  for (int k = 0; k < numTooltips; k++) {
1705  TooltipLine tooltip = new TooltipLine(names[k], text[k]);
1706  tooltip.isModifier = modifier[k];
1707  tooltip.isModifierBad = badModifier[k];
1708  if (k == oneDropLogo) {
1709  tooltip.oneDropLogo = true;
1710  }
1711  tooltips.Add(tooltip);
1712  }
1713  item.modItem?.ModifyTooltips(tooltips);
1714  foreach (var g in HookModifyTooltips.arr)
1715  g.Instance(item).ModifyTooltips(item, tooltips);
1716 
1717  numTooltips = tooltips.Count;
1718  text = new string[numTooltips];
1719  modifier = new bool[numTooltips];
1720  badModifier = new bool[numTooltips];
1721  oneDropLogo = -1;
1722  overrideColor = new Color?[numTooltips];
1723  for (int k = 0; k < numTooltips; k++) {
1724  text[k] = tooltips[k].text;
1725  modifier[k] = tooltips[k].isModifier;
1726  badModifier[k] = tooltips[k].isModifierBad;
1727  if (tooltips[k].oneDropLogo) {
1728  oneDropLogo = k;
1729  }
1730  overrideColor[k] = tooltips[k].overrideColor;
1731  }
1732 
1733  return tooltips;
1734  }
static HookList HookModifyTooltips
Definition: ItemLoader.cs:1700
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 488 of file ItemLoader.cs.

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

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

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

+ Here is the caller graph for this function:

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

Definition at line 1737 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ModNet.GetMod().

1737  {
1738  return item.type != 0 && (item.modItem != null || item.prefix >= PrefixID.Count || HookNeedsSaving.arr.Count(g => g.Instance(item).NeedsSaving(item)) > 0);
1739  }
static HookList HookNeedsSaving
Definition: ItemLoader.cs:1736

+ Here is the call graph for this function:

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 583 of file ItemLoader.cs.

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

583  {
584  if (item.IsAir)
585  return;
586 
587  item.modItem?.OnConsumeAmmo(player);
588  ammo.modItem?.OnConsumeAmmo(player);
589 
590  foreach (var g in HookOnConsumeAmmo.arr) {
591  g.Instance(item).OnConsumeAmmo(item, player);
592  g.Instance(ammo).OnConsumeAmmo(ammo, player);
593  }
594  }
static HookList HookOnConsumeAmmo
Definition: ItemLoader.cs:579
static void Terraria.ModLoader.ItemLoader.OnConsumeItem ( Item  item,
Player  player 
)
static

Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.

Definition at line 793 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

793  {
794  if (item.IsAir)
795  return;
796 
797  item.modItem?.OnConsumeItem(player);
798 
799  foreach (var g in HookOnConsumeItem.arr)
800  g.Instance(item).OnConsumeItem(item, player);
801  }
static HookList HookOnConsumeItem
Definition: ItemLoader.cs:789
static void Terraria.ModLoader.ItemLoader.OnConsumeMana ( Item  item,
Player  player,
int  manaConsumed 
)
static

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

Definition at line 453 of file ItemLoader.cs.

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

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

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

+ Here is the caller graph for this function:

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

Definition at line 1658 of file ItemLoader.cs.

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

1658  {
1659  item.modItem?.OnCraft(recipe);
1660  foreach (var g in HookOnCraft.arr)
1661  g.Instance(item).OnCraft(item, recipe);
1662  }
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 703 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

703  {
704  item.modItem?.OnHitNPC(player, target, damage, knockBack, crit);
705 
706  foreach (var g in HookOnHitNPC.arr)
707  g.Instance(item).OnHitNPC(item, player, target, damage, knockBack, crit);
708  }
static HookList HookOnHitNPC
Definition: ItemLoader.cs:697
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 744 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

744  {
745  item.modItem?.OnHitPvp(player, target, damage, crit);
746 
747  foreach (var g in HookOnHitPvp.arr)
748  g.Instance(item).OnHitPvp(item, player, target, damage, crit);
749  }
static HookList HookOnHitPvp
Definition: ItemLoader.cs:738
static void Terraria.ModLoader.ItemLoader.OnMissingMana ( Item  item,
Player  player,
int  neededMana 
)
static

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

Definition at line 438 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

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

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

+ Here is the caller graph for this function:

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 1440 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1440  {
1441  foreach (var g in HookOnPickup.arr)
1442  if (!g.Instance(item).OnPickup(item, player))
1443  return false;
1444 
1445  return item.modItem?.OnPickup(player) ?? true;
1446  }
static HookList HookOnPickup
Definition: ItemLoader.cs:1434
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 1092 of file ItemLoader.cs.

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

1092  {
1093  ModItem modItem = GetItem(type);
1094  if (modItem != null && modItem.BossBagNPC > 0) {
1095  modItem.OpenBossBag(player);
1096  npc = modItem.BossBagNPC;
1097  }
1098  }
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

+ Here is the call graph for this function:

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

Calls all GlobalItem.OpenVanillaBag hooks.

Definition at line 1127 of file ItemLoader.cs.

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

1127  {
1128  foreach (var g in HookOpenVanillaBag.arr)
1129  g.OpenVanillaBag(context, player, arg);
1130  }
static HookList HookOpenVanillaBag
Definition: ItemLoader.cs:1121
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 547 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

547  {
548  ammo.modItem?.PickAmmo(weapon, player, ref type, ref speed, ref damage, ref knockback);
549  ammo.modItem?.PickAmmo(player, ref type, ref speed, ref damage, ref knockback); // deprecated
550 
551  foreach (var g in HookPickAmmo.arr) {
552  g.Instance(ammo).PickAmmo(weapon, ammo, player, ref type, ref speed, ref damage, ref knockback);
553  }
554  foreach (var g in HookOldPickAmmo.arr) {
555  g.Instance(ammo).PickAmmo(ammo, player, ref type, ref speed, ref damage, ref knockback); // deprecated
556  }
557  }
static HookList HookOldPickAmmo
Definition: ItemLoader.cs:540
static HookList HookPickAmmo
Definition: ItemLoader.cs:543
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 1537 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1538  {
1539  item.modItem?.PostDrawInInventory(spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1540 
1541  foreach (var g in HookPostDrawInInventory.arr)
1542  g.Instance(item).PostDrawInInventory(item, spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1543  }
static HookList HookPostDrawInInventory
Definition: ItemLoader.cs:1530
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 1504 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1504  {
1505  item.modItem?.PostDrawInWorld(spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI);
1506 
1507  foreach (var g in HookPostDrawInWorld.arr)
1508  g.Instance(item).PostDrawInWorld(item, spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI);
1509  }
static HookList HookPostDrawInWorld
Definition: ItemLoader.cs:1498
static void Terraria.ModLoader.ItemLoader.PostDrawTooltip ( Item  item,
ReadOnlyCollection< DrawableTooltipLine lines 
)
static

Definition at line 1676 of file ItemLoader.cs.

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

1676  {
1677  item.modItem?.PostDrawTooltip(lines);
1678  foreach (var g in HookPostDrawTooltip.arr)
1679  g.Instance(item).PostDrawTooltip(item, lines);
1680  }
static HookList HookPostDrawTooltip
Definition: ItemLoader.cs:1675
static void Terraria.ModLoader.ItemLoader.PostDrawTooltipLine ( Item  item,
DrawableTooltipLine  line 
)
static

Definition at line 1694 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1694  {
1695  item.modItem?.PostDrawTooltipLine(line);
1696  foreach (var g in HookPostDrawTooltipLine.arr)
1697  g.Instance(item).PostDrawTooltipLine(item, line);
1698  }
static HookList HookPostDrawTooltipLine
Definition: ItemLoader.cs:1693
static void Terraria.ModLoader.ItemLoader.PostReforge ( Item  item)
static

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

Definition at line 1162 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1162  {
1163  item.modItem?.PostReforge();
1164  foreach (var g in HookPostReforge.arr)
1165  g.Instance(item).PostReforge(item);
1166  }
static HookList HookPostReforge
Definition: ItemLoader.cs:1158
static void Terraria.ModLoader.ItemLoader.PostUpdate ( Item  item)
static

Calls ModItem.PostUpdate and all GlobalItem.PostUpdate hooks.

Definition at line 1388 of file ItemLoader.cs.

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

1388  {
1389  item.modItem?.PostUpdate();
1390 
1391  foreach (var g in HookPostUpdate.arr)
1392  g.Instance(item).PostUpdate(item);
1393  }
static HookList HookPostUpdate
Definition: ItemLoader.cs:1384
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 1518 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1519  {
1520  bool flag = true;
1521  foreach (var g in HookPreDrawInInventory.arr)
1522  flag &= g.Instance(item).PreDrawInInventory(item, spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1523 
1524  if (item.modItem != null)
1525  flag &= item.modItem.PreDrawInInventory(spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1526 
1527  return flag;
1528  }
static HookList HookPreDrawInInventory
Definition: ItemLoader.cs:1511
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 1487 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1487  {
1488  bool flag = true;
1489  if (item.modItem != null)
1490  flag &= item.modItem.PreDrawInWorld(spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI);
1491 
1492  foreach (var g in HookPreDrawInWorld.arr)
1493  flag &= g.Instance(item).PreDrawInWorld(item, spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI);
1494 
1495  return flag;
1496  }
static HookList HookPreDrawInWorld
Definition: ItemLoader.cs:1481
static bool Terraria.ModLoader.ItemLoader.PreDrawTooltip ( Item  item,
ReadOnlyCollection< TooltipLine lines,
ref int  x,
ref int  y 
)
static

Definition at line 1666 of file ItemLoader.cs.

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

1666  {
1667  bool modItemPreDraw = item.modItem?.PreDrawTooltip(lines, ref x, ref y) ?? true;
1668  List<bool> globalItemPreDraw = new List<bool>();
1669  foreach (var g in HookPreDrawTooltip.arr)
1670  globalItemPreDraw.Add(g.PreDrawTooltip(item, lines, ref x, ref y));
1671  return modItemPreDraw && globalItemPreDraw.All(z => z);
1672  }
static HookList HookPreDrawTooltip
Definition: ItemLoader.cs:1665
static bool Terraria.ModLoader.ItemLoader.PreDrawTooltipLine ( Item  item,
DrawableTooltipLine  line,
ref int  yOffset 
)
static

Definition at line 1684 of file ItemLoader.cs.

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

1684  {
1685  bool modItemPreDrawLine = item.modItem?.PreDrawTooltipLine(line, ref yOffset) ?? true;
1686  List<bool> globalItemPreDrawLine = new List<bool>();
1687  foreach (var g in HookPreDrawTooltipLine.arr)
1688  globalItemPreDrawLine.Add(g.PreDrawTooltipLine(item, line, ref yOffset));
1689  return modItemPreDrawLine && globalItemPreDrawLine.All(x => x);
1690  }
static HookList HookPreDrawTooltipLine
Definition: ItemLoader.cs:1683
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 269 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

269  {
270  bool? result = null;
271  foreach (var g in HookPrefixChance.arr) {
272  bool? r = g.Instance(item).PrefixChance(item, pre, rand);
273  if (r.HasValue)
274  result = r.Value && (result ?? true);
275  }
276  if (item.modItem != null) {
277  bool? r = item.modItem.PrefixChance(pre, rand);
278  if (r.HasValue)
279  result = r.Value && (result ?? true);
280  }
281  return result;
282  }
static HookList HookPrefixChance
Definition: ItemLoader.cs:262
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 1108 of file ItemLoader.cs.

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

1108  {
1109  bool result = true;
1110  foreach (var g in HookPreOpenVanillaBag.arr)
1111  result &= g.PreOpenVanillaBag(context, player, arg);
1112 
1113  if (!result) {
1114  NPCLoader.blockLoot.Clear(); // clear blockloot
1115  return false;
1116  }
1117 
1118  return true;
1119  }
static HookList HookPreOpenVanillaBag
Definition: ItemLoader.cs:1100
static bool Terraria.ModLoader.ItemLoader.PreReforge ( Item  item)
static

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

Definition at line 1151 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1151  {
1152  bool b = item.modItem?.NewPreReforge() ?? true;
1153  foreach (var g in HookPreReforge.arr)
1154  b &= g.Instance(item).NewPreReforge(item);
1155  return b;
1156  }
static HookList HookPreReforge
Definition: ItemLoader.cs:1147
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 944 of file ItemLoader.cs.

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

944  {
945  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
946  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
947  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
948  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
949  headTexture.PreUpdateVanitySet(player);
950 
951  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
952  bodyTexture.PreUpdateVanitySet(player);
953 
954  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
955  legTexture.PreUpdateVanitySet(player);
956 
957  foreach (GlobalItem globalItem in HookPreUpdateVanitySet.arr) {
958  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
959  if (!string.IsNullOrEmpty(set))
960  globalItem.PreUpdateVanitySet(player, set);
961  }
962  }
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:6
static HookList HookPreUpdateVanitySet
Definition: ItemLoader.cs:939

+ Here is the call graph for this function:

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 1139 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1139  {
1140  bool b = item.modItem?.ReforgePrice(ref reforgePrice, ref canApplyDiscount) ?? true;
1141  foreach (var g in HookReforgePrice.arr)
1142  b &= g.Instance(item).ReforgePrice(item, ref reforgePrice, ref canApplyDiscount);
1143  return b;
1144  }
static HookList HookReforgePrice
Definition: ItemLoader.cs:1133
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 1061 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1061  {
1062  if (!Main.mouseRightRelease)
1063  return;
1064 
1065  item.modItem?.RightClick(player);
1066 
1067  foreach (var g in HookRightClick.arr)
1068  g.Instance(item).RightClick(item, player);
1069 
1070  if (ConsumeItem(item, player) && --item.stack == 0)
1071  item.SetDefaults();
1072 
1073  Main.PlaySound(7);
1074  Main.stackSplit = 30;
1075  Main.mouseRightRelease = false;
1076  Recipe.FindRecipes();
1077  }
static HookList HookRightClick
Definition: ItemLoader.cs:1048
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:776
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 1020 of file ItemLoader.cs.

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

1020  {
1021  EquipTexture texture = EquipLoader.GetEquipTexture((EquipType)armorSlot, type);
1022  texture?.SetMatch(male, ref equipSlot, ref robes);
1023 
1024  foreach (var g in HookSetMatch.arr)
1025  g.SetMatch(armorSlot, type, male, ref equipSlot, ref robes);
1026  }
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:6
static HookList HookSetMatch
Definition: ItemLoader.cs:1016

+ Here is the call graph for this function:

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 612 of file ItemLoader.cs.

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

612  {
613  bool result = true;
614 
615  foreach (var g in HookShoot.arr) {
616  result &= g.Instance(item).Shoot(item, player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack);
617  }
618 
619  if (result && item.modItem != null) {
620  return item.modItem.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack);
621  }
622 
623  return result;
624  }
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 1377 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1377  {
1378  item.modItem?.Update(ref gravity, ref maxFallSpeed);
1379 
1380  foreach (var g in HookUpdate.arr)
1381  g.Instance(item).Update(item, ref gravity, ref maxFallSpeed);
1382  }
static void Terraria.ModLoader.ItemLoader.UpdateAccessory ( Item  item,
Player  player,
bool  hideVisual 
)
static

Calls ModItem.UpdateAccessory and all GlobalItem.UpdateAccessory hooks.

Definition at line 896 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

896  {
897  if (item.IsAir)
898  return;
899 
900  item.modItem?.UpdateAccessory(player, hideVisual);
901 
902  foreach (var g in HookUpdateAccessory.arr)
903  g.Instance(item).UpdateAccessory(item, player, hideVisual);
904  }
static HookList HookUpdateAccessory
Definition: ItemLoader.cs:890
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 922 of file ItemLoader.cs.

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

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

+ Here is the call graph for this function:

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

Calls ModItem.UpdateEquip and all GlobalItem.UpdateEquip hooks.

Definition at line 880 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

880  {
881  if (item.IsAir)
882  return;
883 
884  item.modItem?.UpdateEquip(player);
885 
886  foreach (var g in HookUpdateEquip.arr)
887  g.Instance(item).UpdateEquip(item, player);
888  }
static HookList HookUpdateEquip
Definition: ItemLoader.cs:874
static void Terraria.ModLoader.ItemLoader.UpdateInventory ( Item  item,
Player  player 
)
static

Calls ModItem.UpdateInventory and all GlobalItem.UpdateInventory hooks.

Definition at line 864 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

864  {
865  if (item.IsAir)
866  return;
867 
868  item.modItem?.UpdateInventory(player);
869 
870  foreach (var g in HookUpdateInventory.arr)
871  g.Instance(item).UpdateInventory(item, player);
872  }
static HookList HookUpdateInventory
Definition: ItemLoader.cs:858
static void Terraria.ModLoader.ItemLoader.UpdateVanity ( Player  player)
static

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

Definition at line 909 of file ItemLoader.cs.

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

909  {
910  foreach (EquipType type in EquipLoader.EquipTypes) {
911  int slot = EquipLoader.GetPlayerEquip(player, type);
912  EquipTexture texture = EquipLoader.GetEquipTexture(type, slot);
913  texture?.UpdateVanity(player, type);
914  }
915  }
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:6

+ Here is the call graph for this function:

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 969 of file ItemLoader.cs.

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

969  {
970  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
971  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
972  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
973  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
974  headTexture.UpdateVanitySet(player);
975 
976  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
977  bodyTexture.UpdateVanitySet(player);
978 
979  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
980  legTexture.UpdateVanitySet(player);
981 
982  foreach (GlobalItem globalItem in HookUpdateVanitySet.arr) {
983  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
984  if (!string.IsNullOrEmpty(set))
985  globalItem.UpdateVanitySet(player, set);
986  }
987  }
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:6
static HookList HookUpdateVanitySet
Definition: ItemLoader.cs:964

+ Here is the call graph for this function:

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 756 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

756  {
757  if (item.IsAir)
758  return false;
759 
760  bool flag = false;
761  if (item.modItem != null)
762  flag |= item.modItem.UseItem(player);
763 
764  foreach (var g in HookUseItem.arr)
765  flag |= g.Instance(item).UseItem(item, player);
766 
767  return flag;
768  }
static HookList HookUseItem
Definition: ItemLoader.cs:751
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 809 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

809  {
810  if (item.modItem != null && item.modItem.UseItemFrame(player))
811  return true;
812 
813  foreach (var g in HookUseItemFrame.arr)
814  if (g.Instance(item).UseItemFrame(item, player))
815  return true;
816 
817  return false;
818  }
static HookList HookUseItemFrame
Definition: ItemLoader.cs:803
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 633 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

633  {
634  item.modItem?.UseItemHitbox(player, ref hitbox, ref noHitbox);
635 
636  foreach (var g in HookUseItemHitbox.arr)
637  g.Instance(item).UseItemHitbox(item, player, ref hitbox, ref noHitbox);
638  }
static HookList HookUseItemHitbox
Definition: ItemLoader.cs:627
static void Terraria.ModLoader.ItemLoader.UseStyle ( Item  item,
Player  player 
)
static

Calls ModItem.UseStyle and all GlobalItem.UseStyle hooks.

Definition at line 322 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

322  {
323  if (item.IsAir)
324  return;
325 
326  item.modItem?.UseStyle(player);
327 
328  foreach (var g in HookUseStyle.arr)
329  g.Instance(item).UseStyle(item, player);
330  }
static HookList HookUseStyle
Definition: ItemLoader.cs:317
static float Terraria.ModLoader.ItemLoader.UseTimeMultiplier ( Item  item,
Player  player 
)
static

Definition at line 363 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

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

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

+ Here is the caller graph for this function:

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 1313 of file ItemLoader.cs.

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

1314  {
1315  Item item = GetWing(player);
1316  if (item == null) {
1317  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1318  texture?.VerticalWingSpeeds(
1319  player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
1320  ref maxAscentMultiplier, ref constantAscend);
1321  return;
1322  }
1323 
1324  item.modItem?.VerticalWingSpeeds(player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
1325  ref maxAscentMultiplier, ref constantAscend);
1326 
1327  foreach (var g in HookVerticalWingSpeeds.arr)
1328  g.Instance(item).VerticalWingSpeeds(item, player, ref ascentWhenFalling, ref ascentWhenRising,
1329  ref maxCanAscendMultiplier, ref maxAscentMultiplier, ref constantAscend);
1330  }
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:1283
static HookList HookVerticalWingSpeeds
Definition: ItemLoader.cs:1307
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:6

+ Here is the call graph for this function:

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 1357 of file ItemLoader.cs.

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

1357  {
1358  if (player.wings <= 0)
1359  return false;
1360 
1361  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wings);
1362  bool? retVal = texture?.WingUpdate(player, inUse);
1363 
1364  foreach (var g in HookWingUpdate.arr)
1365  retVal |= g.WingUpdate(player.wings, player, inUse);
1366 
1367  return retVal ?? false;
1368  }
static HookList HookWingUpdate
Definition: ItemLoader.cs:1353
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:6

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 284 of file ItemLoader.cs.

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

Definition at line 840 of file ItemLoader.cs.

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

Definition at line 1642 of file ItemLoader.cs.

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

Definition at line 1268 of file ItemLoader.cs.

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

Definition at line 989 of file ItemLoader.cs.

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

Definition at line 1585 of file ItemLoader.cs.

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

Definition at line 653 of file ItemLoader.cs.

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

Definition at line 710 of file ItemLoader.cs.

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

Definition at line 1423 of file ItemLoader.cs.

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

Definition at line 1028 of file ItemLoader.cs.

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

Definition at line 296 of file ItemLoader.cs.

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

Definition at line 1623 of file ItemLoader.cs.

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

Definition at line 247 of file ItemLoader.cs.

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

Definition at line 559 of file ItemLoader.cs.

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

Definition at line 770 of file ItemLoader.cs.

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

Definition at line 1254 of file ItemLoader.cs.

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

Definition at line 1217 of file ItemLoader.cs.

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

Definition at line 1182 of file ItemLoader.cs.

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

Definition at line 1169 of file ItemLoader.cs.

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

Definition at line 1198 of file ItemLoader.cs.

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

Definition at line 1233 of file ItemLoader.cs.

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

Definition at line 1601 of file ItemLoader.cs.

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

Definition at line 1459 of file ItemLoader.cs.

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

Definition at line 389 of file ItemLoader.cs.

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

Definition at line 404 of file ItemLoader.cs.

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

Definition at line 518 of file ItemLoader.cs.

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

Definition at line 466 of file ItemLoader.cs.

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

Definition at line 502 of file ItemLoader.cs.

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

Definition at line 1396 of file ItemLoader.cs.

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

Definition at line 1409 of file ItemLoader.cs.

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

Definition at line 347 of file ItemLoader.cs.

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

Definition at line 820 of file ItemLoader.cs.

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

Definition at line 1545 of file ItemLoader.cs.

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

Definition at line 1564 of file ItemLoader.cs.

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

Definition at line 332 of file ItemLoader.cs.

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

Definition at line 1333 of file ItemLoader.cs.

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

Definition at line 1631 of file ItemLoader.cs.

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

Definition at line 1448 of file ItemLoader.cs.

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

Definition at line 640 of file ItemLoader.cs.

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

Definition at line 375 of file ItemLoader.cs.

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

Definition at line 684 of file ItemLoader.cs.

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

Definition at line 725 of file ItemLoader.cs.

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

Definition at line 419 of file ItemLoader.cs.

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

Definition at line 1700 of file ItemLoader.cs.

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

Definition at line 484 of file ItemLoader.cs.

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

Definition at line 482 of file ItemLoader.cs.

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

Definition at line 1736 of file ItemLoader.cs.

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

Definition at line 540 of file ItemLoader.cs.

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

Definition at line 579 of file ItemLoader.cs.

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

Definition at line 789 of file ItemLoader.cs.

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

Definition at line 449 of file ItemLoader.cs.

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

Definition at line 1657 of file ItemLoader.cs.

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

Definition at line 697 of file ItemLoader.cs.

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

Definition at line 738 of file ItemLoader.cs.

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

Definition at line 434 of file ItemLoader.cs.

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

Definition at line 1434 of file ItemLoader.cs.

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

Definition at line 1121 of file ItemLoader.cs.

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

Definition at line 543 of file ItemLoader.cs.

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

Definition at line 1530 of file ItemLoader.cs.

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

Definition at line 1498 of file ItemLoader.cs.

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

Definition at line 1675 of file ItemLoader.cs.

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

Definition at line 1693 of file ItemLoader.cs.

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

Definition at line 1158 of file ItemLoader.cs.

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

Definition at line 1384 of file ItemLoader.cs.

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

Definition at line 1511 of file ItemLoader.cs.

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

Definition at line 1481 of file ItemLoader.cs.

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

Definition at line 1665 of file ItemLoader.cs.

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

Definition at line 1683 of file ItemLoader.cs.

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

Definition at line 262 of file ItemLoader.cs.

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

Definition at line 1100 of file ItemLoader.cs.

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

Definition at line 1147 of file ItemLoader.cs.

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

Definition at line 939 of file ItemLoader.cs.

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

Definition at line 1133 of file ItemLoader.cs.

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

Definition at line 1048 of file ItemLoader.cs.

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

Definition at line 44 of file ItemLoader.cs.

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

Definition at line 193 of file ItemLoader.cs.

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

Definition at line 1016 of file ItemLoader.cs.

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

Definition at line 597 of file ItemLoader.cs.

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

Definition at line 1371 of file ItemLoader.cs.

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

Definition at line 890 of file ItemLoader.cs.

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

Definition at line 917 of file ItemLoader.cs.

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

Definition at line 874 of file ItemLoader.cs.

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

Definition at line 858 of file ItemLoader.cs.

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

Definition at line 964 of file ItemLoader.cs.

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

Definition at line 751 of file ItemLoader.cs.

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

Definition at line 803 of file ItemLoader.cs.

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

Definition at line 627 of file ItemLoader.cs.

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

Definition at line 317 of file ItemLoader.cs.

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

Definition at line 362 of file ItemLoader.cs.

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

Definition at line 1307 of file ItemLoader.cs.

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

Definition at line 1353 of file ItemLoader.cs.

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

Definition at line 23 of file ItemLoader.cs.