Terraria ModLoader  0.10.1.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 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 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 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 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 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 item, 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 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 DelegatePickAmmo (Item item, 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 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 HookModifyTooltips = AddHook<Action<Item, List<TooltipLine>>>(g => g.ModifyTooltips)
 
static HookList HookNeedsSaving = AddHook<Func<Item, bool>>(g => g.NeedsSaving)
 
static HookList HookOnConsumeAmmo = AddHook<Action<Item, Player>>(g => g.OnConsumeAmmo)
 
static HookList HookOnConsumeItem = AddHook<Action<Item, Player>>(g => g.OnConsumeItem)
 
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 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 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.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 731 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

731  {
732  if (item.IsAir)
733  return false;
734 
735  if (item.modItem != null && item.modItem.AltFunctionUse(player))
736  return true;
737 
738  foreach (var g in HookAltFunctionUse.arr)
739  if (g.Instance(item).AltFunctionUse(item, player))
740  return true;
741 
742  return false;
743  }
static HookList HookAltFunctionUse
Definition: ItemLoader.cs:727
static string Terraria.ModLoader.ItemLoader.AnglerChat ( int  type)
static

Definition at line 1527 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1527  {
1528  string chat = "";
1529  string catchLocation = "";
1530  GetItem(type)?.AnglerQuestChat(ref chat, ref catchLocation);
1531 
1532  foreach (var g in HookAnglerChat.arr)
1533  g.AnglerChat(type, ref chat, ref catchLocation);
1534 
1535  if (string.IsNullOrEmpty(chat) || string.IsNullOrEmpty(catchLocation))
1536  return null;
1537 
1538  return chat + "\n\n(" + catchLocation + ")";
1539  }
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:1526
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:915
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 1156 of file ItemLoader.cs.

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

1156  {
1157  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, slot);
1158  texture?.ArmorArmGlowMask(drawPlayer, shadow, ref glowMask, ref color);
1159 
1160  foreach (var g in HookArmorArmGlowMask.arr)
1161  g.ArmorArmGlowMask(slot, drawPlayer, shadow, ref glowMask, ref color);
1162  }
static HookList HookArmorArmGlowMask
Definition: ItemLoader.cs:1152
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 882 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().

882  {
883  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
884  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
885  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
886  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
887  headTexture.ArmorSetShadows(player);
888 
889  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
890  bodyTexture.ArmorSetShadows(player);
891 
892  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
893  legTexture.ArmorSetShadows(player);
894 
895  foreach (GlobalItem globalItem in HookArmorSetShadows.arr) {
896  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
897  if (!string.IsNullOrEmpty(set))
898  globalItem.ArmorSetShadows(player, set);
899  }
900  }
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:876

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

1493  {
1494  if (item.modItem != null) {
1495  item.modItem.AutoLightSelect(ref dryTorch, ref wetTorch, ref glowstick);
1496  if (wetTorch) {
1497  dryTorch = false;
1498  glowstick = false;
1499  }
1500  if (dryTorch) {
1501  glowstick = false;
1502  }
1503  }
1504  }
static bool Terraria.ModLoader.ItemLoader.CanEquipAccessory ( Item  item,
int  slot 
)
static

Definition at line 1472 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1472  {
1473  Player player = Main.player[Main.myPlayer];
1474  if (item.modItem != null && !item.modItem.CanEquipAccessory(player, slot))
1475  return false;
1476 
1477  foreach (var g in HookCanEquipAccessory.arr)
1478  if (!g.Instance(item).CanEquipAccessory(item, player, slot))
1479  return false;
1480 
1481  return true;
1482  }
static HookList HookCanEquipAccessory
Definition: ItemLoader.cs:1469
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 551 of file ItemLoader.cs.

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

551  {
552  bool? canHit = item.modItem?.CanHitNPC(player, target);
553  if (canHit.HasValue && !canHit.Value) {
554  return false;
555  }
556  foreach (var g in HookCanHitNPC.arr) {
557  bool? globalCanHit = g.Instance(item).CanHitNPC(item, player, target);
558  if (globalCanHit.HasValue) {
559  if (globalCanHit.Value) {
560  canHit = true;
561  }
562  else {
563  return false;
564  }
565  }
566  }
567  return canHit;
568  }
static HookList HookCanHitNPC
Definition: ItemLoader.cs:540
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 603 of file ItemLoader.cs.

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

603  {
604  foreach (var g in HookCanHitPvp.arr)
605  if (!g.Instance(item).CanHitPvp(item, player, target))
606  return false;
607 
608  return item.modItem == null || item.modItem.CanHitPvp(player, target);
609  }
static HookList HookCanHitPvp
Definition: ItemLoader.cs:597
static bool Terraria.ModLoader.ItemLoader.CanPickup ( Item  item,
Player  player 
)
static

Definition at line 1310 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1310  {
1311  foreach (var g in HookCanPickup.arr)
1312  if (!g.Instance(item).CanPickup(item, player))
1313  return false;
1314 
1315  return item.modItem?.CanPickup(player) ?? true;
1316  }
static HookList HookCanPickup
Definition: ItemLoader.cs:1307
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 921 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

921  {
922  if (item.IsAir || !Main.mouseRight)
923  return false;
924 
925  if (item.modItem != null && item.modItem.CanRightClick())
926  return true;
927 
928  foreach (var g in HookCanRightClick.arr)
929  if (g.Instance(item).CanRightClick(item))
930  return true;
931 
932  return false;
933  }
static HookList HookCanRightClick
Definition: ItemLoader.cs:915
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 272 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

272  {
273  bool flag = true;
274  if (item.modItem != null)
275  flag &= item.modItem.CanUseItem(player);
276 
277  foreach (var g in HookCanUseItem.arr)
278  flag &= g.Instance(item).CanUseItem(item, player);
279 
280  return flag;
281  }
static HookList HookCanUseItem
Definition: ItemLoader.cs:262
static void Terraria.ModLoader.ItemLoader.CaughtFishStack ( Item  item)
static

Definition at line 1508 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1508  {
1509  item.modItem?.CaughtFishStack(ref item.stack);
1510 
1511  foreach (var g in HookCaughtFishStack.arr)
1512  g.Instance(item).CaughtFishStack(item.type, ref item.stack);
1513  }
static HookList HookCaughtFishStack
Definition: ItemLoader.cs:1507
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 433 of file ItemLoader.cs.

References Terraria.ModLoader.Item.

433  {
434  return item.modItem == null || !item.modItem.OnlyShootOnSwing || player.itemAnimation == player.itemAnimationMax - 1;
435  }
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.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 455 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

455  {
456  if (item.modItem != null && !item.modItem.ConsumeAmmo(player) ||
457  ammo.modItem != null && !ammo.modItem.ConsumeAmmo(player))
458  return false;
459 
460  foreach (var g in HookConsumeAmmo.arr) {
461  if (!g.Instance(item).ConsumeAmmo(item, player) ||
462  !g.Instance(ammo).ConsumeAmmo(ammo, player))
463  return false;
464  }
465 
466  return true;
467  }
static HookList HookConsumeAmmo
Definition: ItemLoader.cs:449
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 663 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

663  {
664  if (item.IsAir) return true;
665  if (item.modItem != null && !item.modItem.ConsumeItem(player))
666  return false;
667 
668  foreach (var g in HookConsumeItem.arr)
669  if (!g.Instance(item).ConsumeItem(item, player))
670  return false;
671 
672  OnConsumeItem(item, player);
673  return true;
674  }
static void OnConsumeItem(Item item, Player player)
Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.
Definition: ItemLoader.cs:680
static HookList HookConsumeItem
Definition: ItemLoader.cs:657
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.DelegatePickAmmo ( Item  item,
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 1142 of file ItemLoader.cs.

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

1143  {
1144  EquipTexture texture = EquipLoader.GetEquipTexture(type, slot);
1145  texture?.DrawArmorColor(drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
1146 
1147  foreach (var g in HookDrawArmorColor.arr)
1148  g.DrawArmorColor(type, slot, drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
1149  }
static HookList HookDrawArmorColor
Definition: ItemLoader.cs:1138

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

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

1105  {
1106  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1107  if (texture != null && !texture.DrawBody())
1108  return false;
1109 
1110  foreach (var g in HookDrawBody.arr)
1111  if (!g.DrawBody(player.head))
1112  return false;
1113 
1114  return true;
1115  }
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:1101

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

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

1074  {
1075  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1076  texture?.DrawHair(ref drawHair, ref drawAltHair);
1077 
1078  foreach (var g in HookDrawHair.arr)
1079  g.DrawHair(player.body, ref drawHair, ref drawAltHair);
1080  }
static HookList HookDrawHair
Definition: ItemLoader.cs:1066
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 1057 of file ItemLoader.cs.

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

1057  {
1058  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1059  texture?.DrawHands(ref drawHands, ref drawArms);
1060 
1061  foreach (var g in HookDrawHands.arr)
1062  g.DrawHands(player.body, ref drawHands, ref drawArms);
1063  }
static HookList HookDrawHands
Definition: ItemLoader.cs:1053
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 1089 of file ItemLoader.cs.

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

1089  {
1090  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1091  if (texture != null && !texture.DrawHead())
1092  return false;
1093 
1094  foreach (var g in HookDrawHead.arr)
1095  if (!g.DrawHead(player.head))
1096  return false;
1097 
1098  return true;
1099  }
static HookList HookDrawHead
Definition: ItemLoader.cs:1082
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 1121 of file ItemLoader.cs.

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

1121  {
1122  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
1123  if (texture != null && !texture.DrawLegs())
1124  return false;
1125 
1126  texture = EquipLoader.GetEquipTexture(EquipType.Shoes, player.shoe);
1127  if (texture != null && !texture.DrawLegs())
1128  return false;
1129 
1130  foreach (var g in HookDrawLegs.arr)
1131  if (!g.DrawLegs(player.legs, player.shoe))
1132  return false;
1133 
1134  return true;
1135  }
static HookList HookDrawLegs
Definition: ItemLoader.cs:1117
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 1486 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1486  {
1487  GetItem(extractType)?.ExtractinatorUse(ref resultType, ref resultStack);
1488 
1489  foreach (var g in HookExtractinatorUse.arr)
1490  g.ExtractinatorUse(extractType, ref resultType, ref resultStack);
1491  }
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:877
static HookList HookExtractinatorUse
Definition: ItemLoader.cs:1485
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 1351 of file ItemLoader.cs.

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

1351  {
1352  if (item.IsAir)
1353  return null;
1354 
1355  foreach (var g in HookGetAlpha.arr) {
1356  Color? color = g.Instance(item).GetAlpha(item, lightColor);
1357  if (color.HasValue)
1358  return color;
1359  }
1360 
1361  return item.modItem?.GetAlpha(lightColor);
1362  }
static HookList HookGetAlpha
Definition: ItemLoader.cs:1343
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 359 of file ItemLoader.cs.

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

359  {
360  if (item.IsAir)
361  return;
362 
363  item.modItem?.GetHealLife(player, quickHeal, ref healValue);
364 
365  foreach (var g in HookGetHealLife.arr)
366  g.Instance(item).GetHealLife(item, player, quickHeal, ref healValue);
367  }
static HookList HookGetHealLife
Definition: ItemLoader.cs:355
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 374 of file ItemLoader.cs.

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

374  {
375  if (item.IsAir)
376  return;
377 
378  item.modItem?.GetHealMana(player, quickHeal, ref healValue);
379 
380  foreach (var g in HookGetHealMana.arr)
381  g.Instance(item).GetHealMana(item, player, quickHeal, ref healValue);
382  }
static HookList HookGetHealMana
Definition: ItemLoader.cs:370
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().

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

References Terraria.ModLoader.ItemLoader.HookList.arr.

420  {
421  if (item.IsAir)
422  return;
423 
424  item.modItem?.GetWeaponCrit(player, ref crit);
425 
426  foreach (var g in HookGetWeaponCrit.arr)
427  g.Instance(item).GetWeaponCrit(item, player, ref crit);
428  }
static HookList HookGetWeaponCrit
Definition: ItemLoader.cs:416
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 389 of file ItemLoader.cs.

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

389  {
390  if (item.IsAir)
391  return;
392 
393  item.modItem?.GetWeaponDamage(player, ref damage);
394 
395  foreach (var g in HookGetWeaponDamage.arr)
396  g.Instance(item).GetWeaponDamage(item, player, ref damage);
397  }
static HookList HookGetWeaponDamage
Definition: ItemLoader.cs:385
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 404 of file ItemLoader.cs.

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

404  {
405  if (item.IsAir)
406  return;
407 
408  item.modItem?.GetWeaponKnockback(player, ref knockback);
409 
410  foreach (var g in HookGetWeaponKnockback.arr)
411  g.Instance(item).GetWeaponKnockback(item, player, ref knockback);
412  }
static HookList HookGetWeaponKnockback
Definition: ItemLoader.cs:400
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 1167 of file ItemLoader.cs.

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

1167  {
1168  Item item = null;
1169  for (int k = 3; k < 8 + player.extraAccessorySlots; k++) {
1170  if (player.armor[k].wingSlot == player.wingsLogic) {
1171  item = player.armor[k];
1172  }
1173  }
1174  if (item != null) {
1175  return item;
1176  }
1177  if (player.wingsLogic > 0 && player.wingsLogic < Main.maxWings) {
1178  item = new Item();
1179  item.SetDefaults(vanillaWings[player.wingsLogic]);
1180  return item;
1181  }
1182  if (player.wingsLogic >= Main.maxWings) {
1183  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1184  if (texture?.item != null)
1185  return texture.item.item;
1186  }
1187  return null;
1188  }
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 1286 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1286  {
1287  item.modItem?.GrabRange(player, ref grabRange);
1288 
1289  foreach (var g in HookGrabRange.arr)
1290  g.Instance(item).GrabRange(item, player, ref grabRange);
1291  }
static HookList HookGrabRange
Definition: ItemLoader.cs:1280
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 1299 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1299  {
1300  foreach (var g in HookGrabStyle.arr)
1301  if (g.Instance(item).GrabStyle(item, player))
1302  return true;
1303 
1304  return item.modItem != null && item.modItem.GrabStyle(player);
1305  }
static HookList HookGrabStyle
Definition: ItemLoader.cs:1293
static bool Terraria.ModLoader.ItemLoader.HasMethod ( Type  t,
string  method,
params Type[]  args 
)
staticprivate

Definition at line 1640 of file ItemLoader.cs.

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

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

Calls ModItem.HoldItem and all GlobalItem.HoldItem hooks.

Definition at line 318 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

318  {
319  if (item.IsAir)
320  return;
321 
322  item.modItem?.HoldItem(player);
323 
324  foreach (var g in HookHoldItem.arr)
325  g.Instance(item).HoldItem(item, player);
326  }
static HookList HookHoldItem
Definition: ItemLoader.cs:313
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 713 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

713  {
714  if (item.IsAir)
715  return false;
716 
717  if (item.modItem != null && item.modItem.HoldItemFrame(player))
718  return true;
719 
720  foreach (var g in HookHoldItemFrame.arr)
721  if (g.Instance(item).HoldItemFrame(item, player))
722  return true;
723 
724  return false;
725  }
static HookList HookHoldItemFrame
Definition: ItemLoader.cs:707
static void Terraria.ModLoader.ItemLoader.HoldoutOffset ( float  gravDir,
int  type,
ref Vector2  offset 
)
static

Definition at line 1430 of file ItemLoader.cs.

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

1430  {
1431  ModItem modItem = GetItem(type);
1432  if (modItem != null) {
1433  Vector2? modOffset = modItem.HoldoutOffset();
1434  if (modOffset.HasValue) {
1435  offset.X = modOffset.Value.X;
1436  offset.Y += gravDir * modOffset.Value.Y;
1437  }
1438  }
1439  foreach (var g in HookHoldoutOffset.arr) {
1440  Vector2? modOffset = g.HoldoutOffset(type);
1441  if (modOffset.HasValue) {
1442  offset.X = modOffset.Value.X;
1443  offset.Y = Main.itemTexture[type].Height / 2f + gravDir * modOffset.Value.Y;
1444  }
1445  }
1446  }
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:1429

+ Here is the call graph for this function:

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

Definition at line 1449 of file ItemLoader.cs.

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

1449  {
1450  Item item = player.inventory[player.selectedItem];
1451  Vector2 modOrigin = Vector2.Zero;
1452  if (item.modItem != null) {
1453  Vector2? modOrigin2 = item.modItem.HoldoutOrigin();
1454  if (modOrigin2.HasValue) {
1455  modOrigin = modOrigin2.Value;
1456  }
1457  }
1458  foreach (var g in HookHoldoutOrigin.arr) {
1459  Vector2? modOrigin2 = g.HoldoutOrigin(item.type);
1460  if (modOrigin2.HasValue) {
1461  modOrigin = modOrigin2.Value;
1462  }
1463  }
1464  modOrigin.X *= player.direction;
1465  modOrigin.Y *= -player.gravDir;
1466  origin += modOrigin;
1467  }
static HookList HookHoldoutOrigin
Definition: ItemLoader.cs:1448
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 303 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

303  {
304  if (item.IsAir || player.pulley || player.itemAnimation > 0)
305  return;
306 
307  item.modItem?.HoldStyle(player);
308 
309  foreach (var g in HookHoldStyle.arr)
310  g.Instance(item).HoldStyle(item, player);
311  }
static HookList HookHoldStyle
Definition: ItemLoader.cs:298
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 1223 of file ItemLoader.cs.

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

1223  {
1224  Item item = GetWing(player);
1225  if (item == null) {
1226  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1227  texture?.HorizontalWingSpeeds(player, ref player.accRunSpeed, ref player.runAcceleration);
1228  return;
1229  }
1230 
1231  item.modItem?.HorizontalWingSpeeds(player, ref player.accRunSpeed, ref player.runAcceleration);
1232 
1233  foreach (var g in HookHorizontalWingSpeeds.arr)
1234  g.Instance(item).HorizontalWingSpeeds(item, player, ref player.accRunSpeed, ref player.runAcceleration);
1235  }
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:1167
static HookList HookHorizontalWingSpeeds
Definition: ItemLoader.cs:1217
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 1516 of file ItemLoader.cs.

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

1516  {
1517  ModItem modItem = GetItem(itemID);
1518  if (modItem != null)
1519  notAvailable |= !modItem.IsAnglerQuestAvailable();
1520 
1521  foreach (var g in HookIsAnglerQuestAvailable.arr)
1522  notAvailable |= !g.IsAnglerQuestAvailable(itemID);
1523  }
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:1515

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

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

Definition at line 1335 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1335  {
1336  foreach (var g in HookItemSpace.arr)
1337  if (g.Instance(item).ItemSpace(item, player))
1338  return true;
1339 
1340  return item.modItem?.ItemSpace(player) ?? false;
1341  }
static HookList HookItemSpace
Definition: ItemLoader.cs:1332
static void Terraria.ModLoader.ItemLoader.MeleeEffects ( Item  item,
Player  player,
Rectangle  hitbox 
)
static

Calls ModItem.MeleeEffects and all GlobalItem.MeleeEffects hooks.

Definition at line 533 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

533  {
534  item.modItem?.MeleeEffects(player, hitbox);
535 
536  foreach (var g in HookMeleeEffects.arr)
537  g.Instance(item).MeleeEffects(item, player, hitbox);
538  }
static HookList HookMeleeEffects
Definition: ItemLoader.cs:527
static float Terraria.ModLoader.ItemLoader.MeleeSpeedMultiplier ( Item  item,
Player  player 
)
static

Definition at line 342 of file ItemLoader.cs.

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

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

342  {
343  if (item.IsAir)
344  return 1f;
345 
346  float multiplier = item.modItem?.MeleeSpeedMultiplier(player) ?? 1f;
347 
348  foreach (var g in HookMeleeSpeedMultiplier.arr)
349  multiplier *= g.Instance(item).MeleeSpeedMultiplier(item, player);
350 
351  return multiplier;
352  }
static HookList HookMeleeSpeedMultiplier
Definition: ItemLoader.cs:341

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

References Terraria.ModLoader.ItemLoader.HookList.arr.

577  {
578  item.modItem?.ModifyHitNPC(player, target, ref damage, ref knockBack, ref crit);
579 
580  foreach (var g in HookModifyHitNPC.arr)
581  g.Instance(item).ModifyHitNPC(item, player, target, ref damage, ref knockBack, ref crit);
582  }
static HookList HookModifyHitNPC
Definition: ItemLoader.cs:571
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 618 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

618  {
619  item.modItem?.ModifyHitPvp(player, target, ref damage, ref crit);
620 
621  foreach (var g in HookModifyHitPvp.arr)
622  g.Instance(item).ModifyHitPvp(item, player, target, ref damage, ref crit);
623  }
static HookList HookModifyHitPvp
Definition: ItemLoader.cs:612
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 1585 of file ItemLoader.cs.

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

1586  {
1587  List<TooltipLine> tooltips = new List<TooltipLine>();
1588  for (int k = 0; k < numTooltips; k++) {
1589  TooltipLine tooltip = new TooltipLine(names[k], text[k]);
1590  tooltip.isModifier = modifier[k];
1591  tooltip.isModifierBad = badModifier[k];
1592  if (k == oneDropLogo) {
1593  tooltip.oneDropLogo = true;
1594  }
1595  tooltips.Add(tooltip);
1596  }
1597  item.modItem?.ModifyTooltips(tooltips);
1598  foreach (var g in HookModifyTooltips.arr)
1599  g.Instance(item).ModifyTooltips(item, tooltips);
1600 
1601  numTooltips = tooltips.Count;
1602  text = new string[numTooltips];
1603  modifier = new bool[numTooltips];
1604  badModifier = new bool[numTooltips];
1605  oneDropLogo = -1;
1606  overrideColor = new Color?[numTooltips];
1607  for (int k = 0; k < numTooltips; k++) {
1608  text[k] = tooltips[k].text;
1609  modifier[k] = tooltips[k].isModifier;
1610  badModifier[k] = tooltips[k].isModifierBad;
1611  if (tooltips[k].oneDropLogo) {
1612  oneDropLogo = k;
1613  }
1614  overrideColor[k] = tooltips[k].overrideColor;
1615  }
1616 
1617  return tooltips;
1618  }
static HookList HookModifyTooltips
Definition: ItemLoader.cs:1584
static bool Terraria.ModLoader.ItemLoader.NeedsModSaving ( Item  item)
static

Definition at line 1621 of file ItemLoader.cs.

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

1621  {
1622  return item.type != 0 && (item.modItem != null || item.prefix >= PrefixID.Count || HookNeedsSaving.arr.Count(g => g.Instance(item).NeedsSaving(item)) > 0);
1623  }
static HookList HookNeedsSaving
Definition: ItemLoader.cs:1620

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

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

473  {
474  if (item.IsAir)
475  return;
476 
477  item.modItem?.OnConsumeAmmo(player);
478  ammo.modItem?.OnConsumeAmmo(player);
479 
480  foreach (var g in HookConsumeAmmo.arr) {
481  g.Instance(item).OnConsumeAmmo(item, player);
482  g.Instance(ammo).OnConsumeAmmo(ammo, player);
483  }
484  }
static HookList HookConsumeAmmo
Definition: ItemLoader.cs:449
static void Terraria.ModLoader.ItemLoader.OnConsumeItem ( Item  item,
Player  player 
)
static

Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.

Definition at line 680 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

680  {
681  if (item.IsAir)
682  return;
683 
684  item.modItem?.OnConsumeItem(player);
685 
686  foreach (var g in HookOnConsumeItem.arr)
687  g.Instance(item).OnConsumeItem(item, player);
688  }
static HookList HookOnConsumeItem
Definition: ItemLoader.cs:676
static void Terraria.ModLoader.ItemLoader.OnCraft ( Item  item,
Recipe  recipe 
)
static

Definition at line 1542 of file ItemLoader.cs.

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

1542  {
1543  item.modItem?.OnCraft(recipe);
1544  foreach (var g in HookOnCraft.arr)
1545  g.Instance(item).OnCraft(item, recipe);
1546  }
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 590 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

590  {
591  item.modItem?.OnHitNPC(player, target, damage, knockBack, crit);
592 
593  foreach (var g in HookOnHitNPC.arr)
594  g.Instance(item).OnHitNPC(item, player, target, damage, knockBack, crit);
595  }
static HookList HookOnHitNPC
Definition: ItemLoader.cs:584
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 631 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

631  {
632  item.modItem?.OnHitPvp(player, target, damage, crit);
633 
634  foreach (var g in HookOnHitPvp.arr)
635  g.Instance(item).OnHitPvp(item, player, target, damage, crit);
636  }
static HookList HookOnHitPvp
Definition: ItemLoader.cs:625
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 1324 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1324  {
1325  foreach (var g in HookOnPickup.arr)
1326  if (!g.Instance(item).OnPickup(item, player))
1327  return false;
1328 
1329  return item.modItem?.OnPickup(player) ?? true;
1330  }
static HookList HookOnPickup
Definition: ItemLoader.cs:1318
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 979 of file ItemLoader.cs.

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

979  {
980  ModItem modItem = GetItem(type);
981  if (modItem != null && modItem.BossBagNPC > 0) {
982  modItem.OpenBossBag(player);
983  npc = modItem.BossBagNPC;
984  }
985  }
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 1011 of file ItemLoader.cs.

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

1011  {
1012  foreach (var g in HookOpenVanillaBag.arr)
1013  g.OpenVanillaBag(context, player, arg);
1014  }
static HookList HookOpenVanillaBag
Definition: ItemLoader.cs:1005
static void Terraria.ModLoader.ItemLoader.PickAmmo ( Item  item,
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 442 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

442  {
443  item.modItem?.PickAmmo(player, ref type, ref speed, ref damage, ref knockback);
444 
445  foreach (var g in HookPickAmmo.arr)
446  g.Instance(item).PickAmmo(item, player, ref type, ref speed, ref damage, ref knockback);
447  }
static HookList HookPickAmmo
Definition: ItemLoader.cs:438
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 1421 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1422  {
1423  item.modItem?.PostDrawInInventory(spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1424 
1425  foreach (var g in HookPostDrawInInventory.arr)
1426  g.Instance(item).PostDrawInInventory(item, spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1427  }
static HookList HookPostDrawInInventory
Definition: ItemLoader.cs:1414
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 1388 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1388  {
1389  item.modItem?.PostDrawInWorld(spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI);
1390 
1391  foreach (var g in HookPostDrawInWorld.arr)
1392  g.Instance(item).PostDrawInWorld(item, spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI);
1393  }
static HookList HookPostDrawInWorld
Definition: ItemLoader.cs:1382
static void Terraria.ModLoader.ItemLoader.PostDrawTooltip ( Item  item,
ReadOnlyCollection< DrawableTooltipLine lines 
)
static

Definition at line 1560 of file ItemLoader.cs.

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

1560  {
1561  item.modItem?.PostDrawTooltip(lines);
1562  foreach (var g in HookPostDrawTooltip.arr)
1563  g.PostDrawTooltip(item, lines);
1564  }
static HookList HookPostDrawTooltip
Definition: ItemLoader.cs:1559
static void Terraria.ModLoader.ItemLoader.PostDrawTooltipLine ( Item  item,
DrawableTooltipLine  line 
)
static

Definition at line 1578 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1578  {
1579  item.modItem?.PostDrawTooltipLine(line);
1580  foreach (var g in HookPostDrawTooltipLine.arr)
1581  g.PostDrawTooltipLine(item, line);
1582  }
static HookList HookPostDrawTooltipLine
Definition: ItemLoader.cs:1577
static void Terraria.ModLoader.ItemLoader.PostReforge ( Item  item)
static

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

Definition at line 1046 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1046  {
1047  item.modItem?.PostReforge();
1048  foreach (var g in HookPostReforge.arr)
1049  g.Instance(item).PostReforge(item);
1050  }
static HookList HookPostReforge
Definition: ItemLoader.cs:1042
static void Terraria.ModLoader.ItemLoader.PostUpdate ( Item  item)
static

Calls ModItem.PostUpdate and all GlobalItem.PostUpdate hooks.

Definition at line 1272 of file ItemLoader.cs.

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

1272  {
1273  item.modItem?.PostUpdate();
1274 
1275  foreach (var g in HookPostUpdate.arr)
1276  g.Instance(item).PostUpdate(item);
1277  }
static HookList HookPostUpdate
Definition: ItemLoader.cs:1268
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 1402 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1403  {
1404  bool flag = true;
1405  foreach (var g in HookPreDrawInInventory.arr)
1406  flag &= g.Instance(item).PreDrawInInventory(item, spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1407 
1408  if (item.modItem != null)
1409  flag &= item.modItem.PreDrawInInventory(spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1410 
1411  return flag;
1412  }
static HookList HookPreDrawInInventory
Definition: ItemLoader.cs:1395
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 1371 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1371  {
1372  bool flag = true;
1373  if (item.modItem != null)
1374  flag &= item.modItem.PreDrawInWorld(spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI);
1375 
1376  foreach (var g in HookPreDrawInWorld.arr)
1377  flag &= g.Instance(item).PreDrawInWorld(item, spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI);
1378 
1379  return flag;
1380  }
static HookList HookPreDrawInWorld
Definition: ItemLoader.cs:1365
static bool Terraria.ModLoader.ItemLoader.PreDrawTooltip ( Item  item,
ReadOnlyCollection< TooltipLine lines,
ref int  x,
ref int  y 
)
static

Definition at line 1550 of file ItemLoader.cs.

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

1550  {
1551  bool modItemPreDraw = item.modItem?.PreDrawTooltip(lines, ref x, ref y) ?? true;
1552  List<bool> globalItemPreDraw = new List<bool>();
1553  foreach (var g in HookPreDrawTooltip.arr)
1554  globalItemPreDraw.Add(g.PreDrawTooltip(item, lines, ref x, ref y));
1555  return modItemPreDraw && globalItemPreDraw.All(z => z);
1556  }
static HookList HookPreDrawTooltip
Definition: ItemLoader.cs:1549
static bool Terraria.ModLoader.ItemLoader.PreDrawTooltipLine ( Item  item,
DrawableTooltipLine  line,
ref int  yOffset 
)
static

Definition at line 1568 of file ItemLoader.cs.

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

1568  {
1569  bool modItemPreDrawLine = item.modItem?.PreDrawTooltipLine(line, ref yOffset) ?? true;
1570  List<bool> globalItemPreDrawLine = new List<bool>();
1571  foreach (var g in HookPreDrawTooltipLine.arr)
1572  globalItemPreDrawLine.Add(g.PreDrawTooltipLine(item, line, ref yOffset));
1573  return modItemPreDrawLine && globalItemPreDrawLine.All(x => x);
1574  }
static HookList HookPreDrawTooltipLine
Definition: ItemLoader.cs:1567
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 995 of file ItemLoader.cs.

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

995  {
996  foreach (var g in HookPreOpenVanillaBag.arr)
997  if (!g.PreOpenVanillaBag(context, player, arg)) {
998  NPCLoader.blockLoot.Clear(); // clear blockloot
999  return false;
1000  }
1001 
1002  return true;
1003  }
static HookList HookPreOpenVanillaBag
Definition: ItemLoader.cs:987
static bool Terraria.ModLoader.ItemLoader.PreReforge ( Item  item)
static

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

Definition at line 1035 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1035  {
1036  bool b = item.modItem?.NewPreReforge() ?? true;
1037  foreach (var g in HookPreReforge.arr)
1038  b &= g.Instance(item).NewPreReforge(item);
1039  return b;
1040  }
static HookList HookPreReforge
Definition: ItemLoader.cs:1031
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 831 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().

831  {
832  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
833  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
834  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
835  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
836  headTexture.PreUpdateVanitySet(player);
837 
838  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
839  bodyTexture.PreUpdateVanitySet(player);
840 
841  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
842  legTexture.PreUpdateVanitySet(player);
843 
844  foreach (GlobalItem globalItem in HookPreUpdateVanitySet.arr) {
845  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
846  if (!string.IsNullOrEmpty(set))
847  globalItem.PreUpdateVanitySet(player, set);
848  }
849  }
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:826

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

References Terraria.ModLoader.ItemLoader.HookList.arr.

1023  {
1024  bool b = item.modItem?.ReforgePrice(ref reforgePrice, ref canApplyDiscount) ?? true;
1025  foreach (var g in HookReforgePrice.arr)
1026  b &= g.Instance(item).ReforgePrice(item, ref reforgePrice, ref canApplyDiscount);
1027  return b;
1028  }
static HookList HookReforgePrice
Definition: ItemLoader.cs:1017
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 948 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

948  {
949  if (!Main.mouseRightRelease)
950  return;
951 
952  item.modItem?.RightClick(player);
953 
954  foreach (var g in HookRightClick.arr)
955  g.Instance(item).RightClick(item, player);
956 
957  if (ConsumeItem(item, player) && --item.stack == 0)
958  item.SetDefaults();
959 
960  Main.PlaySound(7);
961  Main.stackSplit = 30;
962  Main.mouseRightRelease = false;
963  Recipe.FindRecipes();
964  }
static HookList HookRightClick
Definition: ItemLoader.cs:935
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:663
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 907 of file ItemLoader.cs.

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

907  {
908  EquipTexture texture = EquipLoader.GetEquipTexture((EquipType)armorSlot, type);
909  texture?.SetMatch(male, ref equipSlot, ref robes);
910 
911  foreach (var g in HookSetMatch.arr)
912  g.SetMatch(armorSlot, type, male, ref equipSlot, ref robes);
913  }
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:903

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

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

502  {
503  foreach (var g in HookShoot.arr)
504  if (!g.Instance(item).Shoot(item, player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack))
505  return false;
506 
507  if (item.modItem != null && !item.modItem.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack))
508  return false;
509 
510  return true;
511  }
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 1261 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1261  {
1262  item.modItem?.Update(ref gravity, ref maxFallSpeed);
1263 
1264  foreach (var g in HookUpdate.arr)
1265  g.Instance(item).Update(item, ref gravity, ref maxFallSpeed);
1266  }
static void Terraria.ModLoader.ItemLoader.UpdateAccessory ( Item  item,
Player  player,
bool  hideVisual 
)
static

Calls ModItem.UpdateAccessory and all GlobalItem.UpdateAccessory hooks.

Definition at line 783 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

783  {
784  if (item.IsAir)
785  return;
786 
787  item.modItem?.UpdateAccessory(player, hideVisual);
788 
789  foreach (var g in HookUpdateAccessory.arr)
790  g.Instance(item).UpdateAccessory(item, player, hideVisual);
791  }
static HookList HookUpdateAccessory
Definition: ItemLoader.cs:777
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 809 of file ItemLoader.cs.

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

809  {
810  if (head.modItem != null && head.modItem.IsArmorSet(head, body, legs))
811  head.modItem.UpdateArmorSet(player);
812 
813  if (body.modItem != null && body.modItem.IsArmorSet(head, body, legs))
814  body.modItem.UpdateArmorSet(player);
815 
816  if (legs.modItem != null && legs.modItem.IsArmorSet(head, body, legs))
817  legs.modItem.UpdateArmorSet(player);
818 
819  foreach (GlobalItem globalItem in HookUpdateArmorSet.arr) {
820  string set = globalItem.IsArmorSet(head, body, legs);
821  if (!string.IsNullOrEmpty(set))
822  globalItem.UpdateArmorSet(player, set);
823  }
824  }
static HookList HookUpdateArmorSet
Definition: ItemLoader.cs:804

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

References Terraria.ModLoader.ItemLoader.HookList.arr.

767  {
768  if (item.IsAir)
769  return;
770 
771  item.modItem?.UpdateEquip(player);
772 
773  foreach (var g in HookUpdateEquip.arr)
774  g.Instance(item).UpdateEquip(item, player);
775  }
static HookList HookUpdateEquip
Definition: ItemLoader.cs:761
static void Terraria.ModLoader.ItemLoader.UpdateInventory ( Item  item,
Player  player 
)
static

Calls ModItem.UpdateInventory and all GlobalItem.UpdateInventory hooks.

Definition at line 751 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

751  {
752  if (item.IsAir)
753  return;
754 
755  item.modItem?.UpdateInventory(player);
756 
757  foreach (var g in HookUpdateInventory.arr)
758  g.Instance(item).UpdateInventory(item, player);
759  }
static HookList HookUpdateInventory
Definition: ItemLoader.cs:745
static void Terraria.ModLoader.ItemLoader.UpdateVanity ( Player  player)
static

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

Definition at line 796 of file ItemLoader.cs.

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

796  {
797  foreach (EquipType type in EquipLoader.EquipTypes) {
798  int slot = EquipLoader.GetPlayerEquip(player, type);
799  EquipTexture texture = EquipLoader.GetEquipTexture(type, slot);
800  texture?.UpdateVanity(player, type);
801  }
802  }
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 856 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().

856  {
857  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
858  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
859  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
860  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
861  headTexture.UpdateVanitySet(player);
862 
863  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
864  bodyTexture.UpdateVanitySet(player);
865 
866  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
867  legTexture.UpdateVanitySet(player);
868 
869  foreach (GlobalItem globalItem in HookUpdateVanitySet.arr) {
870  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
871  if (!string.IsNullOrEmpty(set))
872  globalItem.UpdateVanitySet(player, set);
873  }
874  }
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:851

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

References Terraria.ModLoader.ItemLoader.HookList.arr.

643  {
644  if (item.IsAir)
645  return false;
646 
647  bool flag = false;
648  if (item.modItem != null)
649  flag |= item.modItem.UseItem(player);
650 
651  foreach (var g in HookUseItem.arr)
652  flag |= g.Instance(item).UseItem(item, player);
653 
654  return flag;
655  }
static HookList HookUseItem
Definition: ItemLoader.cs:638
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 696 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

696  {
697  if (item.modItem != null && item.modItem.UseItemFrame(player))
698  return true;
699 
700  foreach (var g in HookUseItemFrame.arr)
701  if (g.Instance(item).UseItemFrame(item, player))
702  return true;
703 
704  return false;
705  }
static HookList HookUseItemFrame
Definition: ItemLoader.cs:690
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 520 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

520  {
521  item.modItem?.UseItemHitbox(player, ref hitbox, ref noHitbox);
522 
523  foreach (var g in HookUseItemHitbox.arr)
524  g.Instance(item).UseItemHitbox(item, player, ref hitbox, ref noHitbox);
525  }
static HookList HookUseItemHitbox
Definition: ItemLoader.cs:514
static void Terraria.ModLoader.ItemLoader.UseStyle ( Item  item,
Player  player 
)
static

Calls ModItem.UseStyle and all GlobalItem.UseStyle hooks.

Definition at line 288 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

288  {
289  if (item.IsAir)
290  return;
291 
292  item.modItem?.UseStyle(player);
293 
294  foreach (var g in HookUseStyle.arr)
295  g.Instance(item).UseStyle(item, player);
296  }
static HookList HookUseStyle
Definition: ItemLoader.cs:283
static float Terraria.ModLoader.ItemLoader.UseTimeMultiplier ( Item  item,
Player  player 
)
static

Definition at line 329 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

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

329  {
330  if (item.IsAir)
331  return 1f;
332 
333  float multiplier = item.modItem?.UseTimeMultiplier(player) ?? 1f;
334 
335  foreach (var g in HookUseTimeMultiplier.arr)
336  multiplier *= g.Instance(item).UseTimeMultiplier(item, player);
337 
338  return multiplier;
339  }
static HookList HookUseTimeMultiplier
Definition: ItemLoader.cs:328

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

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

1198  {
1199  Item item = GetWing(player);
1200  if (item == null) {
1201  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1202  texture?.VerticalWingSpeeds(
1203  player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
1204  ref maxAscentMultiplier, ref constantAscend);
1205  return;
1206  }
1207 
1208  item.modItem?.VerticalWingSpeeds(player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
1209  ref maxAscentMultiplier, ref constantAscend);
1210 
1211  foreach (var g in HookVerticalWingSpeeds.arr)
1212  g.VerticalWingSpeeds(item, player, ref ascentWhenFalling, ref ascentWhenRising,
1213  ref maxCanAscendMultiplier, ref maxAscentMultiplier, ref constantAscend);
1214  }
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:1167
static HookList HookVerticalWingSpeeds
Definition: ItemLoader.cs:1191
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 1241 of file ItemLoader.cs.

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

1241  {
1242  if (player.wings <= 0)
1243  return false;
1244 
1245  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wings);
1246  bool? retVal = texture?.WingUpdate(player, inUse);
1247 
1248  foreach (var g in HookWingUpdate.arr)
1249  retVal |= g.WingUpdate(player.wings, player, inUse);
1250 
1251  return retVal ?? false;
1252  }
static HookList HookWingUpdate
Definition: ItemLoader.cs:1237
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.HookAltFunctionUse = AddHook<Func<Item, Player, bool>>(g => g.AltFunctionUse)
staticprivate

Definition at line 727 of file ItemLoader.cs.

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

Definition at line 1526 of file ItemLoader.cs.

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

Definition at line 1152 of file ItemLoader.cs.

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

Definition at line 876 of file ItemLoader.cs.

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

Definition at line 1469 of file ItemLoader.cs.

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

Definition at line 540 of file ItemLoader.cs.

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

Definition at line 597 of file ItemLoader.cs.

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

Definition at line 1307 of file ItemLoader.cs.

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

Definition at line 915 of file ItemLoader.cs.

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

Definition at line 262 of file ItemLoader.cs.

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

Definition at line 1507 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 449 of file ItemLoader.cs.

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

Definition at line 657 of file ItemLoader.cs.

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

Definition at line 1138 of file ItemLoader.cs.

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

Definition at line 1101 of file ItemLoader.cs.

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

Definition at line 1066 of file ItemLoader.cs.

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

Definition at line 1053 of file ItemLoader.cs.

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

Definition at line 1082 of file ItemLoader.cs.

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

Definition at line 1117 of file ItemLoader.cs.

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

Definition at line 1485 of file ItemLoader.cs.

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

Definition at line 1343 of file ItemLoader.cs.

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

Definition at line 355 of file ItemLoader.cs.

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

Definition at line 370 of file ItemLoader.cs.

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

Definition at line 416 of file ItemLoader.cs.

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

Definition at line 385 of file ItemLoader.cs.

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

Definition at line 400 of file ItemLoader.cs.

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

Definition at line 1280 of file ItemLoader.cs.

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

Definition at line 1293 of file ItemLoader.cs.

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

Definition at line 313 of file ItemLoader.cs.

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

Definition at line 707 of file ItemLoader.cs.

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

Definition at line 1429 of file ItemLoader.cs.

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

Definition at line 1448 of file ItemLoader.cs.

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

Definition at line 298 of file ItemLoader.cs.

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

Definition at line 1217 of file ItemLoader.cs.

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

Definition at line 1515 of file ItemLoader.cs.

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

Definition at line 1332 of file ItemLoader.cs.

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

Definition at line 527 of file ItemLoader.cs.

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

Definition at line 341 of file ItemLoader.cs.

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

Definition at line 571 of file ItemLoader.cs.

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

Definition at line 612 of file ItemLoader.cs.

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

Definition at line 1584 of file ItemLoader.cs.

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

Definition at line 1620 of file ItemLoader.cs.

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

Definition at line 469 of file ItemLoader.cs.

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

Definition at line 676 of file ItemLoader.cs.

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

Definition at line 1541 of file ItemLoader.cs.

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

Definition at line 584 of file ItemLoader.cs.

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

Definition at line 625 of file ItemLoader.cs.

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

Definition at line 1318 of file ItemLoader.cs.

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

Definition at line 1005 of file ItemLoader.cs.

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

Definition at line 438 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 1414 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 1382 of file ItemLoader.cs.

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

Definition at line 1559 of file ItemLoader.cs.

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

Definition at line 1577 of file ItemLoader.cs.

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

Definition at line 1042 of file ItemLoader.cs.

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

Definition at line 1268 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 1395 of file ItemLoader.cs.

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

Definition at line 1365 of file ItemLoader.cs.

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

Definition at line 1549 of file ItemLoader.cs.

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

Definition at line 1567 of file ItemLoader.cs.

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

Definition at line 987 of file ItemLoader.cs.

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

Definition at line 1031 of file ItemLoader.cs.

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

Definition at line 826 of file ItemLoader.cs.

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

Definition at line 1017 of file ItemLoader.cs.

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

Definition at line 935 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 903 of file ItemLoader.cs.

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

Definition at line 487 of file ItemLoader.cs.

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

Definition at line 1255 of file ItemLoader.cs.

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

Definition at line 777 of file ItemLoader.cs.

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

Definition at line 804 of file ItemLoader.cs.

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

Definition at line 761 of file ItemLoader.cs.

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

Definition at line 745 of file ItemLoader.cs.

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

Definition at line 851 of file ItemLoader.cs.

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

Definition at line 638 of file ItemLoader.cs.

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

Definition at line 690 of file ItemLoader.cs.

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

Definition at line 514 of file ItemLoader.cs.

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

Definition at line 283 of file ItemLoader.cs.

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

Definition at line 328 of file ItemLoader.cs.

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

Definition at line 1191 of file ItemLoader.cs.

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

Definition at line 1237 of file ItemLoader.cs.

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

Definition at line 23 of file ItemLoader.cs.