Terraria ModLoader  0.11.4
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 void ModifyManaCost (Item item, Player player, ref float reduce, ref float mult)
 Calls ModItem.ModifyManaCost, then all GlobalItem.ModifyManaCost hooks. More...
 
static List< TooltipLineModifyTooltips (Item item, ref int numTooltips, string[] names, ref string[] text, ref bool[] modifier, ref bool[] badModifier, ref int oneDropLogo, out Color?[] overrideColor)
 
static void ModifyWeaponDamage (Item item, Player player, ref float add, ref float mult, ref float flat)
 Calls ModItem.HookModifyWeaponDamage, then all GlobalItem.HookModifyWeaponDamage hooks. More...
 
static bool NeedsModSaving (Item item)
 
static void OnConsumeAmmo (Item item, Item ammo, Player player)
 Calls ModItem.OnConsumeAmmo for the weapon, ModItem.OnConsumeAmmo for the ammo, then each GlobalItem.OnConsumeAmmo hook for the weapon and ammo. More...
 
static void OnConsumeItem (Item item, Player player)
 Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks. More...
 
static void OnConsumeMana (Item item, Player player, int manaConsumed)
 Calls ModItem.OnConsumeMana, then all GlobalItem.OnConsumeMana hooks. More...
 
static void OnCraft (Item item, Recipe recipe)
 
static void OnHitNPC (Item item, Player player, NPC target, int damage, float knockBack, bool crit)
 Calls ModItem.OnHitNPC and all GlobalItem.OnHitNPC hooks. More...
 
static void OnHitPvp (Item item, Player player, Player target, int damage, bool crit)
 Calls ModItem.OnHitPvp and all GlobalItem.OnHitPvp hooks. More...
 
static void OnMissingMana (Item item, Player player, int neededMana)
 Calls ModItem.OnMissingMana, then all GlobalItem.OnMissingMana hooks. More...
 
static bool OnPickup (Item item, Player player)
 Calls all GlobalItem.OnPickup hooks then ModItem.OnPickup, until one of the returns false. Returns true if all of the hooks return true. More...
 
static void OpenBossBag (int type, Player player, ref int npc)
 If the item is a modded item and ModItem.bossBagNPC is greater than 0, calls ModItem.OpenBossBag and sets npc to ModItem.bossBagNPC. More...
 
static void OpenVanillaBag (string context, Player player, int arg)
 Calls all GlobalItem.OpenVanillaBag hooks. More...
 
static void PickAmmo (Item weapon, Item ammo, Player player, ref int type, ref float speed, ref int damage, ref float knockback)
 Calls ModItem.PickAmmo, then all GlobalItem.PickAmmo hooks. More...
 
static void PostDrawInInventory (Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
 Calls ModItem.PostDrawInInventory, then all GlobalItem.PostDrawInInventory hooks. More...
 
static void PostDrawInWorld (Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
 Calls ModItem.PostDrawInWorld, then all GlobalItem.PostDrawInWorld hooks. More...
 
static void PostDrawTooltip (Item item, ReadOnlyCollection< DrawableTooltipLine > lines)
 
static void PostDrawTooltipLine (Item item, DrawableTooltipLine line)
 
static void PostReforge (Item item)
 Calls ModItem.PostReforge, then all GlobalItem.PostReforge hooks. More...
 
static void PostUpdate (Item item)
 Calls ModItem.PostUpdate and all GlobalItem.PostUpdate hooks. More...
 
static bool PreDrawInInventory (Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
 Returns the "and" operator on the results of all GlobalItem.PreDrawInInventory hooks and ModItem.PreDrawInInventory. More...
 
static bool PreDrawInWorld (Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
 Returns the "and" operator on the results of ModItem.PreDrawInWorld and all GlobalItem.PreDrawInWorld hooks. More...
 
static bool PreDrawTooltip (Item item, ReadOnlyCollection< TooltipLine > lines, ref int x, ref int y)
 
static bool PreDrawTooltipLine (Item item, DrawableTooltipLine line, ref int yOffset)
 
static bool PreOpenVanillaBag (string context, Player player, int arg)
 Calls each GlobalItem.PreOpenVanillaBag hook until one of them returns false. Returns true if all of them returned true. More...
 
static bool PreReforge (Item item)
 Calls ModItem.PreReforge, then all GlobalItem.PreReforge hooks. More...
 
static void PreUpdateVanitySet (Player player)
 If the player's head texture's IsVanitySet returns true, calls the equipment texture's PreUpdateVanitySet. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.PreUpdateVanitySet, using player.head, player.body, and player.legs. More...
 
static bool ReforgePrice (Item item, ref int reforgePrice, ref bool canApplyDiscount)
 Call all ModItem.ReforgePrice, then GlobalItem.ReforgePrice hooks. More...
 
static void RightClick (Item item, Player player)
 If Main.mouseRightRelease is true, the following steps are taken: More...
 
static void SetMatch (int armorSlot, int type, bool male, ref int equipSlot, ref bool robes)
 Calls EquipTexture.SetMatch, then all GlobalItem.SetMatch hooks. More...
 
static bool Shoot (Item item, Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 Calls each GlobalItem.Shoot hook, then ModItem.Shoot, until one of them returns false. If all of them return true, returns true. More...
 
static void Update (Item item, ref float gravity, ref float maxFallSpeed)
 Calls ModItem.Update, then all GlobalItem.Update hooks. More...
 
static void UpdateAccessory (Item item, Player player, bool hideVisual)
 Calls ModItem.UpdateAccessory and all GlobalItem.UpdateAccessory hooks. More...
 
static void UpdateArmorSet (Player player, Item head, Item body, Item legs)
 If the head's ModItem.IsArmorSet returns true, calls the head's ModItem.UpdateArmorSet. This is then repeated for the body, then the legs. Then for each GlobalItem, if GlobalItem.IsArmorSet returns a non-empty string, calls GlobalItem.UpdateArmorSet with that string. More...
 
static void UpdateEquip (Item item, Player player)
 Calls ModItem.UpdateEquip and all GlobalItem.UpdateEquip hooks. More...
 
static void UpdateInventory (Item item, Player player)
 Calls ModItem.UpdateInventory and all GlobalItem.UpdateInventory hooks. More...
 
static void UpdateVanity (Player player)
 Calls each of the item's equipment texture's UpdateVanity hook. More...
 
static void UpdateVanitySet (Player player)
 If the player's head texture's IsVanitySet returns true, calls the equipment texture's UpdateVanitySet. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.UpdateVanitySet, using player.head, player.body, and player.legs. More...
 
static bool UseItem (Item item, Player player)
 Returns true if any of ModItem.UseItem or GlobalItem.UseItem return true Does not fail fast (calls every hook) More...
 
static bool UseItemFrame (Item item, Player player)
 Calls ModItem.UseItemFrame, then all GlobalItem.UseItemFrame hooks, until one of them returns true. Returns whether any of the hooks returned true. More...
 
static void UseItemHitbox (Item item, Player player, ref Rectangle hitbox, ref bool noHitbox)
 Calls ModItem.UseItemHitbox, then all GlobalItem.UseItemHitbox hooks. More...
 
static void UseStyle (Item item, Player player)
 Calls ModItem.UseStyle and all GlobalItem.UseStyle hooks. More...
 
static float UseTimeMultiplier (Item item, Player player)
 
static void VerticalWingSpeeds (Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
 If the player is using wings, this uses the result of GetWing, and calls ModItem.VerticalWingSpeeds then all GlobalItem.VerticalWingSpeeds hooks. More...
 
static bool WingUpdate (Player player, bool inUse)
 If wings can be seen on the player, calls the player's wing's equipment texture's WingUpdate and all GlobalItem.WingUpdate hooks. More...
 

Static Public Attributes

static int ItemCount => nextItem
 

Private Member Functions

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

Static Private Member Functions

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

Static Private Attributes

static HookList HookAltFunctionUse = AddHook<Func<Item, Player, bool>>(g => g.AltFunctionUse)
 
static HookList HookAnglerChat = AddHook<DelegateAnglerChat>(g => g.AnglerChat)
 
static HookList HookArmorArmGlowMask = AddHook<DelegateArmorArmGlowMask>(g => g.ArmorArmGlowMask)
 
static HookList HookArmorSetShadows = AddHook<Action<Player, string>>(g => g.ArmorSetShadows)
 
static HookList HookCanEquipAccessory = AddHook<Func<Item, Player, int, bool>>(g => g.CanEquipAccessory)
 
static HookList HookCanHitNPC = AddHook<Func<Item, Player, NPC, bool?>>(g => g.CanHitNPC)
 
static HookList HookCanHitPvp = AddHook<Func<Item, Player, Player, bool>>(g => g.CanHitPvp)
 
static HookList HookCanPickup = AddHook<Func<Item, Player, bool>>(g => g.CanPickup)
 
static HookList HookCanRightClick = AddHook<Func<Item, bool>>(g => g.CanRightClick)
 
static HookList HookCanUseItem = AddHook<Func<Item, Player, bool>>(g => g.CanUseItem)
 
static HookList HookCaughtFishStack = AddHook<DelegateCaughtFishStack>(g => g.CaughtFishStack)
 
static HookList HookChoosePrefix = AddHook<Func<Item, UnifiedRandom, int>>(g => g.ChoosePrefix)
 
static HookList HookConsumeAmmo = AddHook<Func<Item, Player, bool>>(g => g.ConsumeAmmo)
 
static HookList HookConsumeItem = AddHook<Func<Item, Player, bool>>(g => g.ConsumeItem)
 
static HookList HookDrawArmorColor = AddHook<DelegateDrawArmorColor>(g => g.DrawArmorColor)
 
static HookList HookDrawBody = AddHook<Func<int, bool>>(g => g.DrawBody)
 
static HookList HookDrawHair = AddHook<DelegateDrawHair>(g => g.DrawHair)
 
static HookList HookDrawHands = AddHook<DelegateDrawHands>(g => g.DrawHands)
 
static HookList HookDrawHead = AddHook<Func<int, bool>>(g => g.DrawHead)
 
static HookList HookDrawLegs = AddHook<Func<int, int, bool>>(g => g.DrawLegs)
 
static HookList HookExtractinatorUse = AddHook<DelegateExtractinatorUse>(g => g.ExtractinatorUse)
 
static HookList HookGetAlpha = AddHook<Func<Item, Color, Color?>>(g => g.GetAlpha)
 
static HookList HookGetHealLife = AddHook<DelegateGetHealLife>(g => g.GetHealLife)
 
static HookList HookGetHealMana = AddHook<DelegateGetHealMana>(g => g.GetHealMana)
 
static HookList HookGetWeaponCrit = AddHook<DelegateGetWeaponCrit>(g => g.GetWeaponCrit)
 
static HookList HookGetWeaponDamage = AddHook<DelegateGetWeaponDamage>(g => g.GetWeaponDamage)
 
static HookList HookGetWeaponKnockback = AddHook<DelegateGetWeaponKnockback>(g => g.GetWeaponKnockback)
 
static HookList HookGrabRange = AddHook<DelegateGrabRange>(g => g.GrabRange)
 
static HookList HookGrabStyle = AddHook<Func<Item, Player, bool>>(g => g.GrabStyle)
 
static HookList HookHoldItem = AddHook<Action<Item, Player>>(g => g.HoldItem)
 
static HookList HookHoldItemFrame = AddHook<Func<Item, Player, bool>>(g => g.HoldItemFrame)
 
static HookList HookHoldoutOffset = AddHook<Func<int, Vector2?>>(g => g.HoldoutOffset)
 
static HookList HookHoldoutOrigin = AddHook<Func<int, Vector2?>>(g => g.HoldoutOrigin)
 
static HookList HookHoldStyle = AddHook<Action<Item, Player>>(g => g.HoldStyle)
 
static HookList HookHorizontalWingSpeeds = AddHook<DelegateHorizontalWingSpeeds>(g => g.HorizontalWingSpeeds)
 
static HookList HookIsAnglerQuestAvailable = AddHook<Func<int, bool>>(g => g.IsAnglerQuestAvailable)
 
static HookList HookItemSpace = AddHook<Func<Item, Player, bool>>(g => g.ItemSpace)
 
static HookList HookMeleeEffects = AddHook<Action<Item, Player, Rectangle>>(g => g.MeleeEffects)
 
static HookList HookMeleeSpeedMultiplier = AddHook<Func<Item, Player, float>>(g => g.MeleeSpeedMultiplier)
 
static HookList HookModifyHitNPC = AddHook<DelegateModifyHitNPC>(g => g.ModifyHitNPC)
 
static HookList HookModifyHitPvp = AddHook<DelegateModifyHitPvp>(g => g.ModifyHitPvp)
 
static HookList HookModifyManaCost = AddHook<DelegateModifyManaCost>(g => g.ModifyManaCost)
 
static HookList HookModifyTooltips = AddHook<Action<Item, List<TooltipLine>>>(g => g.ModifyTooltips)
 
static HookList HookModifyWeaponDamage = AddHook<DelegateModifyWeaponDamage>(g => g.ModifyWeaponDamage)
 
static HookList HookModifyWeaponDamageOld = AddHook<DelegateModifyWeaponDamage>(g => g.ModifyWeaponDamage)
 
static HookList HookNeedsSaving = AddHook<Func<Item, bool>>(g => g.NeedsSaving)
 
static HookList HookOldPickAmmo = AddHook<DelegateOldPickAmmo>(g => g.PickAmmo)
 
static HookList HookOnConsumeAmmo = AddHook<Action<Item, Player>>(g => g.OnConsumeAmmo)
 
static HookList HookOnConsumeItem = AddHook<Action<Item, Player>>(g => g.OnConsumeItem)
 
static HookList HookOnConsumeMana = AddHook<Action<Item, Player, int>>(g => g.OnConsumeMana)
 
static HookList HookOnCraft = AddHook<Action<Item, Recipe>>(g => g.OnCraft)
 
static HookList HookOnHitNPC = AddHook<Action<Item, Player, NPC, int, float, bool>>(g => g.OnHitNPC)
 
static HookList HookOnHitPvp = AddHook<Action<Item, Player, Player, int, bool>>(g => g.OnHitPvp)
 
static HookList HookOnMissingMana = AddHook<Action<Item, Player, int>>(g => g.OnMissingMana)
 
static HookList HookOnPickup = AddHook<Func<Item, Player, bool>>(g => g.OnPickup)
 
static HookList HookOpenVanillaBag = AddHook<Action<string, Player, int>>(g => g.OpenVanillaBag)
 
static HookList HookPickAmmo = AddHook<DelegatePickAmmo>(g => g.PickAmmo)
 
static HookList HookPostDrawInInventory = AddHook<Action<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float>>(g => g.PostDrawInInventory)
 
static HookList HookPostDrawInWorld = AddHook<Action<Item, SpriteBatch, Color, Color, float, float, int>>(g => g.PostDrawInWorld)
 
static HookList HookPostDrawTooltip = AddHook<DelegatePostDrawTooltip>(g => g.PostDrawTooltip)
 
static HookList HookPostDrawTooltipLine = AddHook<DelegatePostDrawTooltipLine>(g => g.PostDrawTooltipLine)
 
static HookList HookPostReforge = AddHook<Action<Item>>(g => g.PostReforge)
 
static HookList HookPostUpdate = AddHook<Action<Item>>(g => g.PostUpdate)
 
static HookList HookPreDrawInInventory = AddHook<Func<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float, bool>>(g => g.PreDrawInInventory)
 
static HookList HookPreDrawInWorld = AddHook<DelegatePreDrawInWorld>(g => g.PreDrawInWorld)
 
static HookList HookPreDrawTooltip = AddHook<DelegatePreDrawTooltip>(g => g.PreDrawTooltip)
 
static HookList HookPreDrawTooltipLine = AddHook<DelegatePreDrawTooltipLine>(g => g.PreDrawTooltipLine)
 
static HookList 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 807 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

807  {
808  if (item.IsAir)
809  return false;
810 
811  if (item.modItem != null && item.modItem.AltFunctionUse(player))
812  return true;
813 
814  foreach (var g in HookAltFunctionUse.arr)
815  if (g.Instance(item).AltFunctionUse(item, player))
816  return true;
817 
818  return false;
819  }
static HookList HookAltFunctionUse
Definition: ItemLoader.cs:803
static string Terraria.ModLoader.ItemLoader.AnglerChat ( int  type)
static

Definition at line 1603 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1603  {
1604  string chat = "";
1605  string catchLocation = "";
1606  GetItem(type)?.AnglerQuestChat(ref chat, ref catchLocation);
1607 
1608  foreach (var g in HookAnglerChat.arr)
1609  g.AnglerChat(type, ref chat, ref catchLocation);
1610 
1611  if (string.IsNullOrEmpty(chat) || string.IsNullOrEmpty(catchLocation))
1612  return null;
1613 
1614  return chat + "\n\n(" + catchLocation + ")";
1615  }
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:1602
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:968
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 1232 of file ItemLoader.cs.

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

1232  {
1233  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, slot);
1234  texture?.ArmorArmGlowMask(drawPlayer, shadow, ref glowMask, ref color);
1235 
1236  foreach (var g in HookArmorArmGlowMask.arr)
1237  g.ArmorArmGlowMask(slot, drawPlayer, shadow, ref glowMask, ref color);
1238  }
static HookList HookArmorArmGlowMask
Definition: ItemLoader.cs:1228
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 958 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().

958  {
959  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
960  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
961  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
962  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
963  headTexture.ArmorSetShadows(player);
964 
965  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
966  bodyTexture.ArmorSetShadows(player);
967 
968  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
969  legTexture.ArmorSetShadows(player);
970 
971  foreach (GlobalItem globalItem in HookArmorSetShadows.arr) {
972  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
973  if (!string.IsNullOrEmpty(set))
974  globalItem.ArmorSetShadows(player, set);
975  }
976  }
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:952

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

1569  {
1570  if (item.modItem != null) {
1571  item.modItem.AutoLightSelect(ref dryTorch, ref wetTorch, ref glowstick);
1572  if (wetTorch) {
1573  dryTorch = false;
1574  glowstick = false;
1575  }
1576  if (dryTorch) {
1577  glowstick = false;
1578  }
1579  }
1580  }
static bool Terraria.ModLoader.ItemLoader.CanEquipAccessory ( Item  item,
int  slot 
)
static

Definition at line 1548 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1548  {
1549  Player player = Main.player[Main.myPlayer];
1550  if (item.modItem != null && !item.modItem.CanEquipAccessory(player, slot))
1551  return false;
1552 
1553  foreach (var g in HookCanEquipAccessory.arr)
1554  if (!g.Instance(item).CanEquipAccessory(item, player, slot))
1555  return false;
1556 
1557  return true;
1558  }
static HookList HookCanEquipAccessory
Definition: ItemLoader.cs:1545
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 627 of file ItemLoader.cs.

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

627  {
628  bool? canHit = item.modItem?.CanHitNPC(player, target);
629  if (canHit.HasValue && !canHit.Value) {
630  return false;
631  }
632  foreach (var g in HookCanHitNPC.arr) {
633  bool? globalCanHit = g.Instance(item).CanHitNPC(item, player, target);
634  if (globalCanHit.HasValue) {
635  if (globalCanHit.Value) {
636  canHit = true;
637  }
638  else {
639  return false;
640  }
641  }
642  }
643  return canHit;
644  }
static HookList HookCanHitNPC
Definition: ItemLoader.cs:616
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 679 of file ItemLoader.cs.

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

679  {
680  foreach (var g in HookCanHitPvp.arr)
681  if (!g.Instance(item).CanHitPvp(item, player, target))
682  return false;
683 
684  return item.modItem == null || item.modItem.CanHitPvp(player, target);
685  }
static HookList HookCanHitPvp
Definition: ItemLoader.cs:673
static bool Terraria.ModLoader.ItemLoader.CanPickup ( Item  item,
Player  player 
)
static

Definition at line 1386 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1386  {
1387  foreach (var g in HookCanPickup.arr)
1388  if (!g.Instance(item).CanPickup(item, player))
1389  return false;
1390 
1391  return item.modItem?.CanPickup(player) ?? true;
1392  }
static HookList HookCanPickup
Definition: ItemLoader.cs:1383
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 997 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

997  {
998  if (item.IsAir || !Main.mouseRight)
999  return false;
1000 
1001  if (item.modItem != null && item.modItem.CanRightClick())
1002  return true;
1003 
1004  foreach (var g in HookCanRightClick.arr)
1005  if (g.Instance(item).CanRightClick(item))
1006  return true;
1007 
1008  return false;
1009  }
static HookList HookCanRightClick
Definition: ItemLoader.cs:991
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 1584 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1584  {
1585  item.modItem?.CaughtFishStack(ref item.stack);
1586 
1587  foreach (var g in HookCaughtFishStack.arr)
1588  g.Instance(item).CaughtFishStack(item.type, ref item.stack);
1589  }
static HookList HookCaughtFishStack
Definition: ItemLoader.cs:1583
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 501 of file ItemLoader.cs.

References Terraria.ModLoader.Item.

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

Definition at line 249 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

249  {
250  foreach (var g in HookChoosePrefix.arr) {
251  int pre = g.Instance(item).ChoosePrefix(item, rand);
252  if (pre >= 0) {
253  return pre;
254  }
255  }
256  if (item.modItem != null) {
257  return item.modItem.ChoosePrefix(rand);
258  }
259  return -1;
260  }
static HookList HookChoosePrefix
Definition: ItemLoader.cs:247
static bool Terraria.ModLoader.ItemLoader.ConsumeAmmo ( Item  item,
Item  ammo,
Player  player 
)
static

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

Definition at line 531 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

531  {
532  if (item.modItem != null && !item.modItem.ConsumeAmmo(player) ||
533  ammo.modItem != null && !ammo.modItem.ConsumeAmmo(player))
534  return false;
535 
536  foreach (var g in HookConsumeAmmo.arr) {
537  if (!g.Instance(item).ConsumeAmmo(item, player) ||
538  !g.Instance(ammo).ConsumeAmmo(ammo, player))
539  return false;
540  }
541 
542  return true;
543  }
static HookList HookConsumeAmmo
Definition: ItemLoader.cs:525
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 739 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

739  {
740  if (item.IsAir) return true;
741  if (item.modItem != null && !item.modItem.ConsumeItem(player))
742  return false;
743 
744  foreach (var g in HookConsumeItem.arr)
745  if (!g.Instance(item).ConsumeItem(item, player))
746  return false;
747 
748  OnConsumeItem(item, player);
749  return true;
750  }
static void OnConsumeItem(Item item, Player player)
Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.
Definition: ItemLoader.cs:756
static HookList HookConsumeItem
Definition: ItemLoader.cs:733
delegate void Terraria.ModLoader.ItemLoader.DelegateAnglerChat ( int  type,
ref string  chat,
ref string  catchLocation 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateArmorArmGlowMask ( int  slot,
Player  drawPlayer,
float  shadow,
ref int  glowMask,
ref Color  color 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateCaughtFishStack ( int  type,
ref int  stack 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateDrawArmorColor ( EquipType  type,
int  slot,
Player  drawPlayer,
float  shadow,
ref Color  color,
ref int  glowMask,
ref Color  glowMaskColor 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateDrawHair ( int  body,
ref bool  drawHair,
ref bool  drawAltHair 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateDrawHands ( int  body,
ref bool  drawHands,
ref bool  drawArms 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateExtractinatorUse ( int  extractType,
ref int  resultType,
ref int  resultStack 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetHealLife ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetHealMana ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponCrit ( Item  item,
Player  player,
ref int  crit 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponDamage ( Item  item,
Player  player,
ref int  damage 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponKnockback ( Item  item,
Player  player,
ref float  knockback 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGrabRange ( Item  item,
Player  player,
ref int  grabRange 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateHorizontalWingSpeeds ( Item  item,
Player  player,
ref float  speed,
ref float  acceleration 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyHitNPC ( Item  item,
Player  player,
NPC  target,
ref int  damage,
ref float  knockBack,
ref bool  crit 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyHitPvp ( Item  item,
Player  player,
Player  target,
ref int  damage,
ref bool  crit 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyManaCost ( Item  item,
Player  player,
ref float  reduce,
ref float  mult 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyWeaponDamage ( Item  item,
Player  player,
ref float  add,
ref float  mult,
ref float  flat 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyWeaponDamageOld ( Item  item,
Player  player,
ref float  add,
ref float  mult 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateOldPickAmmo ( Item  item,
Player  player,
ref int  type,
ref float  speed,
ref int  damage,
ref float  knockback 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegatePickAmmo ( Item  weapon,
Item  ammo,
Player  player,
ref int  type,
ref float  speed,
ref int  damage,
ref float  knockback 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegatePostDrawTooltip ( Item  item,
ReadOnlyCollection< DrawableTooltipLine lines 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegatePostDrawTooltipLine ( Item  item,
DrawableTooltipLine  line 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawInWorld ( Item  item,
SpriteBatch  spriteBatch,
Color  lightColor,
Color  alphaColor,
ref float  rotation,
ref float  scale,
int  whoAmI 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawTooltip ( Item  item,
ReadOnlyCollection< TooltipLine lines,
ref int  x,
ref int  y 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawTooltipLine ( Item  item,
DrawableTooltipLine  line,
ref int  yOffset 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegateReforgePrice ( Item  item,
ref int  reforgePrice,
ref bool  canApplyDiscount 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateSetMatch ( int  armorSlot,
int  type,
bool  male,
ref int  equipSlot,
ref bool  robes 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegateShoot ( Item  item,
Player  player,
ref Vector2  position,
ref float  speedX,
ref float  speedY,
ref int  type,
ref int  damage,
ref float  knockBack 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateUpdate ( Item  item,
ref float  gravity,
ref float  maxFallSpeed 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateUseItemHitbox ( Item  item,
Player  player,
ref Rectangle  hitbox,
ref bool  noHitbox 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateVerticalWingSpeeds ( Item  item,
Player  player,
ref float  ascentWhenFalling,
ref float  ascentWhenRising,
ref float  maxCanAscendMultiplier,
ref float  maxAscentMultiplier,
ref float  constantAscend 
)
private
static void Terraria.ModLoader.ItemLoader.DrawArmorColor ( EquipType  type,
int  slot,
Player  drawPlayer,
float  shadow,
ref Color  color,
ref int  glowMask,
ref Color  glowMaskColor 
)
static

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

Definition at line 1218 of file ItemLoader.cs.

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

1219  {
1220  EquipTexture texture = EquipLoader.GetEquipTexture(type, slot);
1221  texture?.DrawArmorColor(drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
1222 
1223  foreach (var g in HookDrawArmorColor.arr)
1224  g.DrawArmorColor(type, slot, drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
1225  }
static HookList HookDrawArmorColor
Definition: ItemLoader.cs:1214

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

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

1181  {
1182  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1183  if (texture != null && !texture.DrawBody())
1184  return false;
1185 
1186  foreach (var g in HookDrawBody.arr)
1187  if (!g.DrawBody(player.head))
1188  return false;
1189 
1190  return true;
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
static HookList HookDrawBody
Definition: ItemLoader.cs:1177

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

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

1150  {
1151  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1152  texture?.DrawHair(ref drawHair, ref drawAltHair);
1153 
1154  foreach (var g in HookDrawHair.arr)
1155  g.DrawHair(player.body, ref drawHair, ref drawAltHair);
1156  }
static HookList HookDrawHair
Definition: ItemLoader.cs:1142
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 1133 of file ItemLoader.cs.

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

1133  {
1134  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1135  texture?.DrawHands(ref drawHands, ref drawArms);
1136 
1137  foreach (var g in HookDrawHands.arr)
1138  g.DrawHands(player.body, ref drawHands, ref drawArms);
1139  }
static HookList HookDrawHands
Definition: ItemLoader.cs:1129
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 1165 of file ItemLoader.cs.

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

1165  {
1166  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1167  if (texture != null && !texture.DrawHead())
1168  return false;
1169 
1170  foreach (var g in HookDrawHead.arr)
1171  if (!g.DrawHead(player.head))
1172  return false;
1173 
1174  return true;
1175  }
static HookList HookDrawHead
Definition: ItemLoader.cs:1158
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 1197 of file ItemLoader.cs.

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

1197  {
1198  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
1199  if (texture != null && !texture.DrawLegs())
1200  return false;
1201 
1202  texture = EquipLoader.GetEquipTexture(EquipType.Shoes, player.shoe);
1203  if (texture != null && !texture.DrawLegs())
1204  return false;
1205 
1206  foreach (var g in HookDrawLegs.arr)
1207  if (!g.DrawLegs(player.legs, player.shoe))
1208  return false;
1209 
1210  return true;
1211  }
static HookList HookDrawLegs
Definition: ItemLoader.cs:1193
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 1562 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1562  {
1563  GetItem(extractType)?.ExtractinatorUse(ref resultType, ref resultStack);
1564 
1565  foreach (var g in HookExtractinatorUse.arr)
1566  g.ExtractinatorUse(extractType, ref resultType, ref resultStack);
1567  }
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:930
static HookList HookExtractinatorUse
Definition: ItemLoader.cs:1561
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 1427 of file ItemLoader.cs.

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

1427  {
1428  if (item.IsAir)
1429  return null;
1430 
1431  foreach (var g in HookGetAlpha.arr) {
1432  Color? color = g.Instance(item).GetAlpha(item, lightColor);
1433  if (color.HasValue)
1434  return color;
1435  }
1436 
1437  return item.modItem?.GetAlpha(lightColor);
1438  }
static HookList HookGetAlpha
Definition: ItemLoader.cs:1419
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(), and Terraria.ModLoader.ModContent.MusicExists().

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

+ Here is the caller graph for this function:

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

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

Definition at line 488 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

488  {
489  if (item.IsAir)
490  return;
491 
492  item.modItem?.GetWeaponCrit(player, ref crit);
493 
494  foreach (var g in HookGetWeaponCrit.arr)
495  g.Instance(item).GetWeaponCrit(item, player, ref crit);
496  }
static HookList HookGetWeaponCrit
Definition: ItemLoader.cs:484
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 437 of file ItemLoader.cs.

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

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

437  {
438  if (item.IsAir)
439  return;
440 
441  item.modItem?.GetWeaponDamage(player, ref damage);
442 
443  foreach (var g in HookGetWeaponDamage.arr)
444  g.Instance(item).GetWeaponDamage(item, player, ref damage);
445  }
static HookList HookGetWeaponDamage
Definition: ItemLoader.cs:432

+ Here is the caller graph for this function:

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

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

Definition at line 472 of file ItemLoader.cs.

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

472  {
473  if (item.IsAir)
474  return;
475 
476  item.modItem?.GetWeaponKnockback(player, ref knockback);
477 
478  foreach (var g in HookGetWeaponKnockback.arr)
479  g.Instance(item).GetWeaponKnockback(item, player, ref knockback);
480  }
static HookList HookGetWeaponKnockback
Definition: ItemLoader.cs:468
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 1243 of file ItemLoader.cs.

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

1243  {
1244  Item item = null;
1245  for (int k = 3; k < 8 + player.extraAccessorySlots; k++) {
1246  if (player.armor[k].wingSlot == player.wingsLogic) {
1247  item = player.armor[k];
1248  }
1249  }
1250  if (item != null) {
1251  return item;
1252  }
1253  if (player.wingsLogic > 0 && player.wingsLogic < Main.maxWings) {
1254  item = new Item();
1255  item.SetDefaults(vanillaWings[player.wingsLogic]);
1256  return item;
1257  }
1258  if (player.wingsLogic >= Main.maxWings) {
1259  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1260  if (texture?.item != null)
1261  return texture.item.item;
1262  }
1263  return null;
1264  }
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 1362 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1362  {
1363  item.modItem?.GrabRange(player, ref grabRange);
1364 
1365  foreach (var g in HookGrabRange.arr)
1366  g.Instance(item).GrabRange(item, player, ref grabRange);
1367  }
static HookList HookGrabRange
Definition: ItemLoader.cs:1356
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 1375 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1375  {
1376  foreach (var g in HookGrabStyle.arr)
1377  if (g.Instance(item).GrabStyle(item, player))
1378  return true;
1379 
1380  return item.modItem != null && item.modItem.GrabStyle(player);
1381  }
static HookList HookGrabStyle
Definition: ItemLoader.cs:1369
static bool Terraria.ModLoader.ItemLoader.HasMethod ( Type  t,
string  method,
params Type[]  args 
)
staticprivate

Definition at line 1716 of file ItemLoader.cs.

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

1716  {
1717  return t.GetMethod(method, args).DeclaringType != typeof(GlobalItem);
1718  }
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 789 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

789  {
790  if (item.IsAir)
791  return false;
792 
793  if (item.modItem != null && item.modItem.HoldItemFrame(player))
794  return true;
795 
796  foreach (var g in HookHoldItemFrame.arr)
797  if (g.Instance(item).HoldItemFrame(item, player))
798  return true;
799 
800  return false;
801  }
static HookList HookHoldItemFrame
Definition: ItemLoader.cs:783
static void Terraria.ModLoader.ItemLoader.HoldoutOffset ( float  gravDir,
int  type,
ref Vector2  offset 
)
static

Definition at line 1506 of file ItemLoader.cs.

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

1506  {
1507  ModItem modItem = GetItem(type);
1508  if (modItem != null) {
1509  Vector2? modOffset = modItem.HoldoutOffset();
1510  if (modOffset.HasValue) {
1511  offset.X = modOffset.Value.X;
1512  offset.Y += gravDir * modOffset.Value.Y;
1513  }
1514  }
1515  foreach (var g in HookHoldoutOffset.arr) {
1516  Vector2? modOffset = g.HoldoutOffset(type);
1517  if (modOffset.HasValue) {
1518  offset.X = modOffset.Value.X;
1519  offset.Y = Main.itemTexture[type].Height / 2f + gravDir * modOffset.Value.Y;
1520  }
1521  }
1522  }
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:1505

+ Here is the call graph for this function:

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

Definition at line 1525 of file ItemLoader.cs.

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

1525  {
1526  Item item = player.inventory[player.selectedItem];
1527  Vector2 modOrigin = Vector2.Zero;
1528  if (item.modItem != null) {
1529  Vector2? modOrigin2 = item.modItem.HoldoutOrigin();
1530  if (modOrigin2.HasValue) {
1531  modOrigin = modOrigin2.Value;
1532  }
1533  }
1534  foreach (var g in HookHoldoutOrigin.arr) {
1535  Vector2? modOrigin2 = g.Instance(item).HoldoutOrigin(item.type);
1536  if (modOrigin2.HasValue) {
1537  modOrigin = modOrigin2.Value;
1538  }
1539  }
1540  modOrigin.X *= player.direction;
1541  modOrigin.Y *= -player.gravDir;
1542  origin += modOrigin;
1543  }
static HookList HookHoldoutOrigin
Definition: ItemLoader.cs:1524
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 1299 of file ItemLoader.cs.

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

1299  {
1300  Item item = GetWing(player);
1301  if (item == null) {
1302  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1303  texture?.HorizontalWingSpeeds(player, ref player.accRunSpeed, ref player.runAcceleration);
1304  return;
1305  }
1306 
1307  item.modItem?.HorizontalWingSpeeds(player, ref player.accRunSpeed, ref player.runAcceleration);
1308 
1309  foreach (var g in HookHorizontalWingSpeeds.arr)
1310  g.Instance(item).HorizontalWingSpeeds(item, player, ref player.accRunSpeed, ref player.runAcceleration);
1311  }
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:1243
static HookList HookHorizontalWingSpeeds
Definition: ItemLoader.cs:1293
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 1592 of file ItemLoader.cs.

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

1592  {
1593  ModItem modItem = GetItem(itemID);
1594  if (modItem != null)
1595  notAvailable |= !modItem.IsAnglerQuestAvailable();
1596 
1597  foreach (var g in HookIsAnglerQuestAvailable.arr)
1598  notAvailable |= !g.IsAnglerQuestAvailable(itemID);
1599  }
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:1591

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

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

Definition at line 1411 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1411  {
1412  foreach (var g in HookItemSpace.arr)
1413  if (g.Instance(item).ItemSpace(item, player))
1414  return true;
1415 
1416  return item.modItem?.ItemSpace(player) ?? false;
1417  }
static HookList HookItemSpace
Definition: ItemLoader.cs:1408
static void Terraria.ModLoader.ItemLoader.MeleeEffects ( Item  item,
Player  player,
Rectangle  hitbox 
)
static

Calls ModItem.MeleeEffects and all GlobalItem.MeleeEffects hooks.

Definition at line 609 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

609  {
610  item.modItem?.MeleeEffects(player, hitbox);
611 
612  foreach (var g in HookMeleeEffects.arr)
613  g.Instance(item).MeleeEffects(item, player, hitbox);
614  }
static HookList HookMeleeEffects
Definition: ItemLoader.cs:603
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 653 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

653  {
654  item.modItem?.ModifyHitNPC(player, target, ref damage, ref knockBack, ref crit);
655 
656  foreach (var g in HookModifyHitNPC.arr)
657  g.Instance(item).ModifyHitNPC(item, player, target, ref damage, ref knockBack, ref crit);
658  }
static HookList HookModifyHitNPC
Definition: ItemLoader.cs:647
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 694 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

694  {
695  item.modItem?.ModifyHitPvp(player, target, ref damage, ref crit);
696 
697  foreach (var g in HookModifyHitPvp.arr)
698  g.Instance(item).ModifyHitPvp(item, player, target, ref damage, ref crit);
699  }
static HookList HookModifyHitPvp
Definition: ItemLoader.cs:688
static void Terraria.ModLoader.ItemLoader.ModifyManaCost ( Item  item,
Player  player,
ref float  reduce,
ref float  mult 
)
static

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

Definition at line 389 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

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

389  {
390  if (item.IsAir)
391  return;
392 
393  item.modItem?.ModifyManaCost(player, ref reduce, ref mult);
394 
395  foreach (var g in HookModifyManaCost.arr) {
396  g.Instance(item).ModifyManaCost(item, player, ref reduce, ref mult);
397  }
398  }
static HookList HookModifyManaCost
Definition: ItemLoader.cs:385

+ Here is the caller graph for this function:

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

Definition at line 1661 of file ItemLoader.cs.

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

1662  {
1663  List<TooltipLine> tooltips = new List<TooltipLine>();
1664  for (int k = 0; k < numTooltips; k++) {
1665  TooltipLine tooltip = new TooltipLine(names[k], text[k]);
1666  tooltip.isModifier = modifier[k];
1667  tooltip.isModifierBad = badModifier[k];
1668  if (k == oneDropLogo) {
1669  tooltip.oneDropLogo = true;
1670  }
1671  tooltips.Add(tooltip);
1672  }
1673  item.modItem?.ModifyTooltips(tooltips);
1674  foreach (var g in HookModifyTooltips.arr)
1675  g.Instance(item).ModifyTooltips(item, tooltips);
1676 
1677  numTooltips = tooltips.Count;
1678  text = new string[numTooltips];
1679  modifier = new bool[numTooltips];
1680  badModifier = new bool[numTooltips];
1681  oneDropLogo = -1;
1682  overrideColor = new Color?[numTooltips];
1683  for (int k = 0; k < numTooltips; k++) {
1684  text[k] = tooltips[k].text;
1685  modifier[k] = tooltips[k].isModifier;
1686  badModifier[k] = tooltips[k].isModifierBad;
1687  if (tooltips[k].oneDropLogo) {
1688  oneDropLogo = k;
1689  }
1690  overrideColor[k] = tooltips[k].overrideColor;
1691  }
1692 
1693  return tooltips;
1694  }
static HookList HookModifyTooltips
Definition: ItemLoader.cs:1660
static void Terraria.ModLoader.ItemLoader.ModifyWeaponDamage ( Item  item,
Player  player,
ref float  add,
ref float  mult,
ref float  flat 
)
static

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

Definition at line 454 of file ItemLoader.cs.

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

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

454  {
455  if (item.IsAir)
456  return;
457 
458  item.modItem?.ModifyWeaponDamage(player, ref add, ref mult);
459  item.modItem?.ModifyWeaponDamage(player, ref add, ref mult, ref flat);
460 
461  foreach (var g in HookModifyWeaponDamageOld.arr)
462  g.Instance(item).ModifyWeaponDamage(item, player, ref add, ref mult);
463  foreach (var g in HookModifyWeaponDamage.arr)
464  g.Instance(item).ModifyWeaponDamage(item, player, ref add, ref mult, ref flat);
465  }
static HookList HookModifyWeaponDamageOld
Definition: ItemLoader.cs:448
static HookList HookModifyWeaponDamage
Definition: ItemLoader.cs:450

+ Here is the caller graph for this function:

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

Definition at line 1697 of file ItemLoader.cs.

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

1697  {
1698  return item.type != 0 && (item.modItem != null || item.prefix >= PrefixID.Count || HookNeedsSaving.arr.Count(g => g.Instance(item).NeedsSaving(item)) > 0);
1699  }
static HookList HookNeedsSaving
Definition: ItemLoader.cs:1696

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

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

549  {
550  if (item.IsAir)
551  return;
552 
553  item.modItem?.OnConsumeAmmo(player);
554  ammo.modItem?.OnConsumeAmmo(player);
555 
556  foreach (var g in HookOnConsumeAmmo.arr) {
557  g.Instance(item).OnConsumeAmmo(item, player);
558  g.Instance(ammo).OnConsumeAmmo(ammo, player);
559  }
560  }
static HookList HookOnConsumeAmmo
Definition: ItemLoader.cs:545
static void Terraria.ModLoader.ItemLoader.OnConsumeItem ( Item  item,
Player  player 
)
static

Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.

Definition at line 756 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

756  {
757  if (item.IsAir)
758  return;
759 
760  item.modItem?.OnConsumeItem(player);
761 
762  foreach (var g in HookOnConsumeItem.arr)
763  g.Instance(item).OnConsumeItem(item, player);
764  }
static HookList HookOnConsumeItem
Definition: ItemLoader.cs:752
static void Terraria.ModLoader.ItemLoader.OnConsumeMana ( Item  item,
Player  player,
int  manaConsumed 
)
static

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

Definition at line 419 of file ItemLoader.cs.

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

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

419  {
420  if (item.IsAir)
421  return;
422 
423  item.modItem?.OnConsumeMana(player, manaConsumed);
424 
425  foreach (var g in HookOnConsumeMana.arr) {
426  g.Instance(item).OnConsumeMana(item, player, manaConsumed);
427  }
428  }
static HookList HookOnConsumeMana
Definition: ItemLoader.cs:415

+ Here is the caller graph for this function:

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

Definition at line 1618 of file ItemLoader.cs.

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

1618  {
1619  item.modItem?.OnCraft(recipe);
1620  foreach (var g in HookOnCraft.arr)
1621  g.Instance(item).OnCraft(item, recipe);
1622  }
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 666 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

666  {
667  item.modItem?.OnHitNPC(player, target, damage, knockBack, crit);
668 
669  foreach (var g in HookOnHitNPC.arr)
670  g.Instance(item).OnHitNPC(item, player, target, damage, knockBack, crit);
671  }
static HookList HookOnHitNPC
Definition: ItemLoader.cs:660
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 707 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

707  {
708  item.modItem?.OnHitPvp(player, target, damage, crit);
709 
710  foreach (var g in HookOnHitPvp.arr)
711  g.Instance(item).OnHitPvp(item, player, target, damage, crit);
712  }
static HookList HookOnHitPvp
Definition: ItemLoader.cs:701
static void Terraria.ModLoader.ItemLoader.OnMissingMana ( Item  item,
Player  player,
int  neededMana 
)
static

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

Definition at line 404 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

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

404  {
405  if (item.IsAir)
406  return;
407 
408  item.modItem?.OnMissingMana(player, neededMana);
409 
410  foreach (var g in HookOnMissingMana.arr) {
411  g.Instance(item).OnMissingMana(item, player, neededMana);
412  }
413  }
static HookList HookOnMissingMana
Definition: ItemLoader.cs:400

+ Here is the caller graph for this function:

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

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

Definition at line 1400 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1400  {
1401  foreach (var g in HookOnPickup.arr)
1402  if (!g.Instance(item).OnPickup(item, player))
1403  return false;
1404 
1405  return item.modItem?.OnPickup(player) ?? true;
1406  }
static HookList HookOnPickup
Definition: ItemLoader.cs:1394
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 1055 of file ItemLoader.cs.

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

1055  {
1056  ModItem modItem = GetItem(type);
1057  if (modItem != null && modItem.BossBagNPC > 0) {
1058  modItem.OpenBossBag(player);
1059  npc = modItem.BossBagNPC;
1060  }
1061  }
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 1087 of file ItemLoader.cs.

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

1087  {
1088  foreach (var g in HookOpenVanillaBag.arr)
1089  g.OpenVanillaBag(context, player, arg);
1090  }
static HookList HookOpenVanillaBag
Definition: ItemLoader.cs:1081
static void Terraria.ModLoader.ItemLoader.PickAmmo ( Item  weapon,
Item  ammo,
Player  player,
ref int  type,
ref float  speed,
ref int  damage,
ref float  knockback 
)
static

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

Definition at line 513 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

513  {
514  ammo.modItem?.PickAmmo(weapon, player, ref type, ref speed, ref damage, ref knockback);
515  ammo.modItem?.PickAmmo(player, ref type, ref speed, ref damage, ref knockback); // deprecated
516 
517  foreach (var g in HookPickAmmo.arr) {
518  g.Instance(ammo).PickAmmo(weapon, ammo, player, ref type, ref speed, ref damage, ref knockback);
519  }
520  foreach (var g in HookOldPickAmmo.arr) {
521  g.Instance(ammo).PickAmmo(ammo, player, ref type, ref speed, ref damage, ref knockback); // deprecated
522  }
523  }
static HookList HookOldPickAmmo
Definition: ItemLoader.cs:506
static HookList HookPickAmmo
Definition: ItemLoader.cs:509
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 1497 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1498  {
1499  item.modItem?.PostDrawInInventory(spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1500 
1501  foreach (var g in HookPostDrawInInventory.arr)
1502  g.Instance(item).PostDrawInInventory(item, spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1503  }
static HookList HookPostDrawInInventory
Definition: ItemLoader.cs:1490
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 1464 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1464  {
1465  item.modItem?.PostDrawInWorld(spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI);
1466 
1467  foreach (var g in HookPostDrawInWorld.arr)
1468  g.Instance(item).PostDrawInWorld(item, spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI);
1469  }
static HookList HookPostDrawInWorld
Definition: ItemLoader.cs:1458
static void Terraria.ModLoader.ItemLoader.PostDrawTooltip ( Item  item,
ReadOnlyCollection< DrawableTooltipLine lines 
)
static

Definition at line 1636 of file ItemLoader.cs.

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

1636  {
1637  item.modItem?.PostDrawTooltip(lines);
1638  foreach (var g in HookPostDrawTooltip.arr)
1639  g.Instance(item).PostDrawTooltip(item, lines);
1640  }
static HookList HookPostDrawTooltip
Definition: ItemLoader.cs:1635
static void Terraria.ModLoader.ItemLoader.PostDrawTooltipLine ( Item  item,
DrawableTooltipLine  line 
)
static

Definition at line 1654 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1654  {
1655  item.modItem?.PostDrawTooltipLine(line);
1656  foreach (var g in HookPostDrawTooltipLine.arr)
1657  g.Instance(item).PostDrawTooltipLine(item, line);
1658  }
static HookList HookPostDrawTooltipLine
Definition: ItemLoader.cs:1653
static void Terraria.ModLoader.ItemLoader.PostReforge ( Item  item)
static

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

Definition at line 1122 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1122  {
1123  item.modItem?.PostReforge();
1124  foreach (var g in HookPostReforge.arr)
1125  g.Instance(item).PostReforge(item);
1126  }
static HookList HookPostReforge
Definition: ItemLoader.cs:1118
static void Terraria.ModLoader.ItemLoader.PostUpdate ( Item  item)
static

Calls ModItem.PostUpdate and all GlobalItem.PostUpdate hooks.

Definition at line 1348 of file ItemLoader.cs.

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

1348  {
1349  item.modItem?.PostUpdate();
1350 
1351  foreach (var g in HookPostUpdate.arr)
1352  g.Instance(item).PostUpdate(item);
1353  }
static HookList HookPostUpdate
Definition: ItemLoader.cs:1344
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 1478 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1479  {
1480  bool flag = true;
1481  foreach (var g in HookPreDrawInInventory.arr)
1482  flag &= g.Instance(item).PreDrawInInventory(item, spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1483 
1484  if (item.modItem != null)
1485  flag &= item.modItem.PreDrawInInventory(spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1486 
1487  return flag;
1488  }
static HookList HookPreDrawInInventory
Definition: ItemLoader.cs:1471
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 1447 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1447  {
1448  bool flag = true;
1449  if (item.modItem != null)
1450  flag &= item.modItem.PreDrawInWorld(spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI);
1451 
1452  foreach (var g in HookPreDrawInWorld.arr)
1453  flag &= g.Instance(item).PreDrawInWorld(item, spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI);
1454 
1455  return flag;
1456  }
static HookList HookPreDrawInWorld
Definition: ItemLoader.cs:1441
static bool Terraria.ModLoader.ItemLoader.PreDrawTooltip ( Item  item,
ReadOnlyCollection< TooltipLine lines,
ref int  x,
ref int  y 
)
static

Definition at line 1626 of file ItemLoader.cs.

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

1626  {
1627  bool modItemPreDraw = item.modItem?.PreDrawTooltip(lines, ref x, ref y) ?? true;
1628  List<bool> globalItemPreDraw = new List<bool>();
1629  foreach (var g in HookPreDrawTooltip.arr)
1630  globalItemPreDraw.Add(g.PreDrawTooltip(item, lines, ref x, ref y));
1631  return modItemPreDraw && globalItemPreDraw.All(z => z);
1632  }
static HookList HookPreDrawTooltip
Definition: ItemLoader.cs:1625
static bool Terraria.ModLoader.ItemLoader.PreDrawTooltipLine ( Item  item,
DrawableTooltipLine  line,
ref int  yOffset 
)
static

Definition at line 1644 of file ItemLoader.cs.

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

1644  {
1645  bool modItemPreDrawLine = item.modItem?.PreDrawTooltipLine(line, ref yOffset) ?? true;
1646  List<bool> globalItemPreDrawLine = new List<bool>();
1647  foreach (var g in HookPreDrawTooltipLine.arr)
1648  globalItemPreDrawLine.Add(g.PreDrawTooltipLine(item, line, ref yOffset));
1649  return modItemPreDrawLine && globalItemPreDrawLine.All(x => x);
1650  }
static HookList HookPreDrawTooltipLine
Definition: ItemLoader.cs:1643
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 1071 of file ItemLoader.cs.

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

1071  {
1072  foreach (var g in HookPreOpenVanillaBag.arr)
1073  if (!g.PreOpenVanillaBag(context, player, arg)) {
1074  NPCLoader.blockLoot.Clear(); // clear blockloot
1075  return false;
1076  }
1077 
1078  return true;
1079  }
static HookList HookPreOpenVanillaBag
Definition: ItemLoader.cs:1063
static bool Terraria.ModLoader.ItemLoader.PreReforge ( Item  item)
static

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

Definition at line 1111 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1111  {
1112  bool b = item.modItem?.NewPreReforge() ?? true;
1113  foreach (var g in HookPreReforge.arr)
1114  b &= g.Instance(item).NewPreReforge(item);
1115  return b;
1116  }
static HookList HookPreReforge
Definition: ItemLoader.cs:1107
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 907 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().

907  {
908  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
909  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
910  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
911  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
912  headTexture.PreUpdateVanitySet(player);
913 
914  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
915  bodyTexture.PreUpdateVanitySet(player);
916 
917  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
918  legTexture.PreUpdateVanitySet(player);
919 
920  foreach (GlobalItem globalItem in HookPreUpdateVanitySet.arr) {
921  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
922  if (!string.IsNullOrEmpty(set))
923  globalItem.PreUpdateVanitySet(player, set);
924  }
925  }
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:902

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

References Terraria.ModLoader.ItemLoader.HookList.arr.

1099  {
1100  bool b = item.modItem?.ReforgePrice(ref reforgePrice, ref canApplyDiscount) ?? true;
1101  foreach (var g in HookReforgePrice.arr)
1102  b &= g.Instance(item).ReforgePrice(item, ref reforgePrice, ref canApplyDiscount);
1103  return b;
1104  }
static HookList HookReforgePrice
Definition: ItemLoader.cs:1093
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 1024 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1024  {
1025  if (!Main.mouseRightRelease)
1026  return;
1027 
1028  item.modItem?.RightClick(player);
1029 
1030  foreach (var g in HookRightClick.arr)
1031  g.Instance(item).RightClick(item, player);
1032 
1033  if (ConsumeItem(item, player) && --item.stack == 0)
1034  item.SetDefaults();
1035 
1036  Main.PlaySound(7);
1037  Main.stackSplit = 30;
1038  Main.mouseRightRelease = false;
1039  Recipe.FindRecipes();
1040  }
static HookList HookRightClick
Definition: ItemLoader.cs:1011
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:739
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 983 of file ItemLoader.cs.

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

983  {
984  EquipTexture texture = EquipLoader.GetEquipTexture((EquipType)armorSlot, type);
985  texture?.SetMatch(male, ref equipSlot, ref robes);
986 
987  foreach (var g in HookSetMatch.arr)
988  g.SetMatch(armorSlot, type, male, ref equipSlot, ref robes);
989  }
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:979

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

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

578  {
579  foreach (var g in HookShoot.arr)
580  if (!g.Instance(item).Shoot(item, player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack))
581  return false;
582 
583  if (item.modItem != null && !item.modItem.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack))
584  return false;
585 
586  return true;
587  }
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 1337 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1337  {
1338  item.modItem?.Update(ref gravity, ref maxFallSpeed);
1339 
1340  foreach (var g in HookUpdate.arr)
1341  g.Instance(item).Update(item, ref gravity, ref maxFallSpeed);
1342  }
static void Terraria.ModLoader.ItemLoader.UpdateAccessory ( Item  item,
Player  player,
bool  hideVisual 
)
static

Calls ModItem.UpdateAccessory and all GlobalItem.UpdateAccessory hooks.

Definition at line 859 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

859  {
860  if (item.IsAir)
861  return;
862 
863  item.modItem?.UpdateAccessory(player, hideVisual);
864 
865  foreach (var g in HookUpdateAccessory.arr)
866  g.Instance(item).UpdateAccessory(item, player, hideVisual);
867  }
static HookList HookUpdateAccessory
Definition: ItemLoader.cs:853
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 885 of file ItemLoader.cs.

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

885  {
886  if (head.modItem != null && head.modItem.IsArmorSet(head, body, legs))
887  head.modItem.UpdateArmorSet(player);
888 
889  if (body.modItem != null && body.modItem.IsArmorSet(head, body, legs))
890  body.modItem.UpdateArmorSet(player);
891 
892  if (legs.modItem != null && legs.modItem.IsArmorSet(head, body, legs))
893  legs.modItem.UpdateArmorSet(player);
894 
895  foreach (GlobalItem globalItem in HookUpdateArmorSet.arr) {
896  string set = globalItem.IsArmorSet(head, body, legs);
897  if (!string.IsNullOrEmpty(set))
898  globalItem.UpdateArmorSet(player, set);
899  }
900  }
static HookList HookUpdateArmorSet
Definition: ItemLoader.cs:880

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

References Terraria.ModLoader.ItemLoader.HookList.arr.

843  {
844  if (item.IsAir)
845  return;
846 
847  item.modItem?.UpdateEquip(player);
848 
849  foreach (var g in HookUpdateEquip.arr)
850  g.Instance(item).UpdateEquip(item, player);
851  }
static HookList HookUpdateEquip
Definition: ItemLoader.cs:837
static void Terraria.ModLoader.ItemLoader.UpdateInventory ( Item  item,
Player  player 
)
static

Calls ModItem.UpdateInventory and all GlobalItem.UpdateInventory hooks.

Definition at line 827 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

827  {
828  if (item.IsAir)
829  return;
830 
831  item.modItem?.UpdateInventory(player);
832 
833  foreach (var g in HookUpdateInventory.arr)
834  g.Instance(item).UpdateInventory(item, player);
835  }
static HookList HookUpdateInventory
Definition: ItemLoader.cs:821
static void Terraria.ModLoader.ItemLoader.UpdateVanity ( Player  player)
static

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

Definition at line 872 of file ItemLoader.cs.

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

872  {
873  foreach (EquipType type in EquipLoader.EquipTypes) {
874  int slot = EquipLoader.GetPlayerEquip(player, type);
875  EquipTexture texture = EquipLoader.GetEquipTexture(type, slot);
876  texture?.UpdateVanity(player, type);
877  }
878  }
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 932 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().

932  {
933  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
934  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
935  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
936  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
937  headTexture.UpdateVanitySet(player);
938 
939  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
940  bodyTexture.UpdateVanitySet(player);
941 
942  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
943  legTexture.UpdateVanitySet(player);
944 
945  foreach (GlobalItem globalItem in HookUpdateVanitySet.arr) {
946  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
947  if (!string.IsNullOrEmpty(set))
948  globalItem.UpdateVanitySet(player, set);
949  }
950  }
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:927

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

References Terraria.ModLoader.ItemLoader.HookList.arr.

719  {
720  if (item.IsAir)
721  return false;
722 
723  bool flag = false;
724  if (item.modItem != null)
725  flag |= item.modItem.UseItem(player);
726 
727  foreach (var g in HookUseItem.arr)
728  flag |= g.Instance(item).UseItem(item, player);
729 
730  return flag;
731  }
static HookList HookUseItem
Definition: ItemLoader.cs:714
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 772 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

772  {
773  if (item.modItem != null && item.modItem.UseItemFrame(player))
774  return true;
775 
776  foreach (var g in HookUseItemFrame.arr)
777  if (g.Instance(item).UseItemFrame(item, player))
778  return true;
779 
780  return false;
781  }
static HookList HookUseItemFrame
Definition: ItemLoader.cs:766
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 596 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

596  {
597  item.modItem?.UseItemHitbox(player, ref hitbox, ref noHitbox);
598 
599  foreach (var g in HookUseItemHitbox.arr)
600  g.Instance(item).UseItemHitbox(item, player, ref hitbox, ref noHitbox);
601  }
static HookList HookUseItemHitbox
Definition: ItemLoader.cs:590
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 1273 of file ItemLoader.cs.

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

1274  {
1275  Item item = GetWing(player);
1276  if (item == null) {
1277  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1278  texture?.VerticalWingSpeeds(
1279  player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
1280  ref maxAscentMultiplier, ref constantAscend);
1281  return;
1282  }
1283 
1284  item.modItem?.VerticalWingSpeeds(player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
1285  ref maxAscentMultiplier, ref constantAscend);
1286 
1287  foreach (var g in HookVerticalWingSpeeds.arr)
1288  g.Instance(item).VerticalWingSpeeds(item, player, ref ascentWhenFalling, ref ascentWhenRising,
1289  ref maxCanAscendMultiplier, ref maxAscentMultiplier, ref constantAscend);
1290  }
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:1243
static HookList HookVerticalWingSpeeds
Definition: ItemLoader.cs:1267
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 1317 of file ItemLoader.cs.

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

1317  {
1318  if (player.wings <= 0)
1319  return false;
1320 
1321  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wings);
1322  bool? retVal = texture?.WingUpdate(player, inUse);
1323 
1324  foreach (var g in HookWingUpdate.arr)
1325  retVal |= g.WingUpdate(player.wings, player, inUse);
1326 
1327  return retVal ?? false;
1328  }
static HookList HookWingUpdate
Definition: ItemLoader.cs:1313
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 803 of file ItemLoader.cs.

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

Definition at line 1602 of file ItemLoader.cs.

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

Definition at line 1228 of file ItemLoader.cs.

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

Definition at line 952 of file ItemLoader.cs.

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

Definition at line 1545 of file ItemLoader.cs.

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

Definition at line 616 of file ItemLoader.cs.

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

Definition at line 673 of file ItemLoader.cs.

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

Definition at line 1383 of file ItemLoader.cs.

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

Definition at line 991 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 1583 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 525 of file ItemLoader.cs.

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

Definition at line 733 of file ItemLoader.cs.

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

Definition at line 1214 of file ItemLoader.cs.

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

Definition at line 1177 of file ItemLoader.cs.

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

Definition at line 1142 of file ItemLoader.cs.

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

Definition at line 1129 of file ItemLoader.cs.

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

Definition at line 1158 of file ItemLoader.cs.

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

Definition at line 1193 of file ItemLoader.cs.

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

Definition at line 1561 of file ItemLoader.cs.

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

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

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

Definition at line 432 of file ItemLoader.cs.

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

Definition at line 468 of file ItemLoader.cs.

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

Definition at line 1356 of file ItemLoader.cs.

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

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

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

Definition at line 1505 of file ItemLoader.cs.

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

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

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

Definition at line 1591 of file ItemLoader.cs.

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

Definition at line 1408 of file ItemLoader.cs.

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

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

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

Definition at line 688 of file ItemLoader.cs.

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

Definition at line 385 of file ItemLoader.cs.

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

Definition at line 1660 of file ItemLoader.cs.

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

Definition at line 450 of file ItemLoader.cs.

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

Definition at line 448 of file ItemLoader.cs.

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

Definition at line 1696 of file ItemLoader.cs.

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

Definition at line 506 of file ItemLoader.cs.

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

Definition at line 545 of file ItemLoader.cs.

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

Definition at line 752 of file ItemLoader.cs.

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

Definition at line 415 of file ItemLoader.cs.

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

Definition at line 1617 of file ItemLoader.cs.

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

Definition at line 660 of file ItemLoader.cs.

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

Definition at line 701 of file ItemLoader.cs.

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

Definition at line 400 of file ItemLoader.cs.

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

Definition at line 1394 of file ItemLoader.cs.

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

Definition at line 1081 of file ItemLoader.cs.

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

Definition at line 509 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 1490 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 1458 of file ItemLoader.cs.

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

Definition at line 1635 of file ItemLoader.cs.

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

Definition at line 1653 of file ItemLoader.cs.

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

Definition at line 1118 of file ItemLoader.cs.

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

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

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

Definition at line 1441 of file ItemLoader.cs.

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

Definition at line 1625 of file ItemLoader.cs.

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

Definition at line 1643 of file ItemLoader.cs.

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

Definition at line 1063 of file ItemLoader.cs.

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

Definition at line 1107 of file ItemLoader.cs.

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

Definition at line 902 of file ItemLoader.cs.

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

Definition at line 1093 of file ItemLoader.cs.

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

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

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

Definition at line 563 of file ItemLoader.cs.

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

Definition at line 1331 of file ItemLoader.cs.

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

Definition at line 853 of file ItemLoader.cs.

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

Definition at line 880 of file ItemLoader.cs.

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

Definition at line 837 of file ItemLoader.cs.

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

Definition at line 821 of file ItemLoader.cs.

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

Definition at line 927 of file ItemLoader.cs.

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

Definition at line 714 of file ItemLoader.cs.

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

Definition at line 766 of file ItemLoader.cs.

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

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

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

Definition at line 1313 of file ItemLoader.cs.

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

Definition at line 23 of file ItemLoader.cs.