TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches
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:

Static Public Member Functions

static T AddModHook< T > (T hook)
 
static ModItem GetItem (int type)
 Gets the ModItem template instance corresponding to the specified type (not the clone/new instance which gets added to Items as the game is played). Returns null if no modded item has the given type.
 
static void OnCreated (Item item, ItemCreationContext context)
 
static int ChoosePrefix (Item item, UnifiedRandom rand)
 
static ? bool PrefixChance (Item item, int pre, UnifiedRandom rand)
 Allows for blocking, forcing and altering chance of prefix rolling. False (block) takes precedence over True (force). Null gives vanilla behavior.
 
static bool AllowPrefix (Item item, int pre)
 
static bool CanUseItem (Item item, Player player)
 
static ? bool CanAutoReuseItem (Item item, Player player)
 
static void UseStyle (Item item, Player player, Rectangle heldItemFrame)
 Calls ModItem.UseStyle and all GlobalItem.UseStyle hooks.
 
static void HoldStyle (Item item, Player player, Rectangle heldItemFrame)
 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.
Returns whether or not the vanilla logic should be skipped.
 
static void HoldItem (Item item, Player player)
 Calls ModItem.HoldItem and all GlobalItem.HoldItem hooks.
 
static float UseTimeMultiplier (Item item, Player player)
 
static float UseAnimationMultiplier (Item item, Player player)
 
static float UseSpeedMultiplier (Item item, Player player)
 
static void GetHealLife (Item item, Player player, bool quickHeal, ref int healValue)
 Calls ModItem.GetHealLife, then all GlobalItem.GetHealLife hooks.
 
static void GetHealMana (Item item, Player player, bool quickHeal, ref int healValue)
 Calls ModItem.GetHealMana, then all GlobalItem.GetHealMana hooks.
 
static void ModifyManaCost (Item item, Player player, ref float reduce, ref float mult)
 Calls ModItem.ModifyManaCost, then all GlobalItem.ModifyManaCost hooks.
 
static void OnMissingMana (Item item, Player player, int neededMana)
 Calls ModItem.OnMissingMana, then all GlobalItem.OnMissingMana hooks.
 
static void OnConsumeMana (Item item, Player player, int manaConsumed)
 Calls ModItem.OnConsumeMana, then all GlobalItem.OnConsumeMana hooks.
 
static ? bool CanConsumeBait (Player player, Item bait)
 
static void ModifyResearchSorting (Item item, ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
 
static bool CanResearch (Item item)
 Hook that determines if an item will be prevented from being consumed by the research function.
 
static void OnResearched (Item item, bool fullyResearched)
 
static void ModifyWeaponDamage (Item item, Player player, ref StatModifier damage)
 Calls ModItem.HookModifyWeaponDamage, then all GlobalItem.HookModifyWeaponDamage hooks.
 
static void ModifyWeaponKnockback (Item item, Player player, ref StatModifier knockback)
 Calls ModItem.ModifyWeaponKnockback, then all GlobalItem.ModifyWeaponKnockback hooks.
 
static void ModifyWeaponCrit (Item item, Player player, ref float crit)
 Calls ModItem.ModifyWeaponCrit, then all GlobalItem.ModifyWeaponCrit hooks.
 
static bool NeedsAmmo (Item weapon, Player player)
 Calls ModItem.NeedsAmmo, then all GlobalItem.NeedsAmmo hooks, until any of them returns false.
 
static void PickAmmo (Item weapon, Item ammo, Player player, ref int type, ref float speed, ref StatModifier damage, ref float knockback)
 Calls ModItem.PickAmmo, then all GlobalItem.PickAmmo hooks.
 
static bool CanChooseAmmo (Item weapon, Item ammo, Player player)
 Calls each M:Terraria.ModLoader.GlobalItem.CanChooseAmmo(Terraria.Item,Terraria.Item,Terraria.Player) hook for the weapon, and each M:Terraria.ModLoader.GlobalItem.CanBeChosenAsAmmo(Terraria.Item,Terraria.Item,Terraria.Player) hook for the ammo,
then each corresponding hook in T:Terraria.ModLoader.ModItem if applicable for the weapon and/or ammo, until one of them returns a concrete false value.
If all of them fail to do this, returns either true (if one returned true prior) or ammo.ammo == weapon.useAmmo.
 
static bool CanConsumeAmmo (Item weapon, Item ammo, Player player)
 Calls each M:Terraria.ModLoader.GlobalItem.CanConsumeAmmo(Terraria.Item,Terraria.Item,Terraria.Player) hook for the weapon, and each M:Terraria.ModLoader.GlobalItem.CanBeConsumedAsAmmo(Terraria.Item,Terraria.Item,Terraria.Player) hook for the ammo,
then each corresponding hook in T:Terraria.ModLoader.ModItem if applicable for the weapon and/or ammo, until one of them returns a concrete false value.
If all of them fail to do this, returns true.
 
static void OnConsumeAmmo (Item weapon, Item ammo, Player player)
 Calls M:Terraria.ModLoader.ModItem.OnConsumeAmmo(Terraria.Item,Terraria.Player) for the weapon, M:Terraria.ModLoader.ModItem.OnConsumedAsAmmo(Terraria.Item,Terraria.Player) for the ammo, then each corresponding hook for the weapon and ammo.
 
static bool CanShoot (Item item, Player player)
 Calls each GlobalItem.CanShoot hook, then ModItem.CanShoot, until one of them returns false. If all of them return true, returns true.
 
static void ModifyShootStats (Item item, Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
 Calls ModItem.ModifyShootStats, then each GlobalItem.ModifyShootStats hook.
 
static bool Shoot (Item item, Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback, bool defaultResult=true)
 Calls each GlobalItem.Shoot hook then, if none of them returns false, calls the ModItem.Shoot hook and returns its value.
 
static void UseItemHitbox (Item item, Player player, ref Rectangle hitbox, ref bool noHitbox)
 Calls ModItem.UseItemHitbox, then all GlobalItem.UseItemHitbox hooks.
 
static void MeleeEffects (Item item, Player player, Rectangle hitbox)
 Calls ModItem.MeleeEffects and all GlobalItem.MeleeEffects hooks.
 
static ? bool CanCatchNPC (Item item, NPC target, Player player)
 Gathers the results of all M:Terraria.ModLoader.GlobalItem.CanCatchNPC(Terraria.Item,Terraria.NPC,Terraria.Player) hooks, then the M:Terraria.ModLoader.ModItem.CanCatchNPC(Terraria.NPC,Terraria.Player) hook if applicable.
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.

 
static void OnCatchNPC (Item item, NPC npc, Player player, bool failed)
 
static void ModifyItemScale (Item item, Player player, ref float scale)
 Calls M:Terraria.ModLoader.ModItem.ModifyItemScale(Terraria.Player,System.Single@) if applicable, then all applicable M:Terraria.ModLoader.GlobalItem.ModifyItemScale(Terraria.Item,Terraria.Player,System.Single@) instances.
 
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.
 
static ? bool CanMeleeAttackCollideWithNPC (Item item, Rectangle meleeAttackHitbox, Player player, NPC target)
 
static void ModifyHitNPC (Item item, Player player, NPC target, ref NPC.HitModifiers modifiers)
 Calls ModItem.ModifyHitNPC, then all GlobalItem.ModifyHitNPC hooks.
 
static void OnHitNPC (Item item, Player player, NPC target, in NPC.HitInfo hit, int damageDone)
 Calls ModItem.OnHitNPC and all GlobalItem.OnHitNPC hooks.
 
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.
 
static void ModifyHitPvp (Item item, Player player, Player target, ref Player.HurtModifiers modifiers)
 Calls ModItem.ModifyHitPvp, then all GlobalItem.ModifyHitPvp hooks.
 
static void OnHitPvp (Item item, Player player, Player target, Player.HurtInfo hurtInfo)
 Calls ModItem.OnHitPvp and all GlobalItem.OnHitPvp hooks.
Called on local, server and remote clients.

 
static ? bool UseItem (Item item, Player player)
 Returns false if any of ModItem.UseItem or GlobalItem.UseItem return false. Returns true if anything returns true without returning false. Returns null by default. Does not fail fast (calls every hook)
 
static void UseAnimation (Item item, Player player)
 
static bool ConsumeItem (Item item, Player player)
 If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to false.
 
static void OnConsumeItem (Item item, Player player)
 Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.
 
static void 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.
 
static void 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.
 
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.
 
static void UpdateInventory (Item item, Player player)
 Calls ModItem.UpdateInventory and all GlobalItem.UpdateInventory hooks.
 
static void UpdateInfoAccessory (Item item, Player player)
 Calls ModItem.UpdateInfoAccessory and all GlobalItem.UpdateInfoAccessory hooks.
 
static void UpdateEquip (Item item, Player player)
 Hook at the end of Player.VanillaUpdateEquip can be called to apply additional code related to accessory slots for a particular item.
 
static void UpdateAccessory (Item item, Player player, bool hideVisual)
 Hook at the end of Player.ApplyEquipFunctional can be called to apply additional code related to accessory slots for a particular item.
 
static void UpdateVanity (Item item, Player player)
 Hook at the end of Player.ApplyEquipVanity can be called to apply additional code related to accessory slots for a particular item.
 
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.
 
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.
 
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.
 
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.
 
static void SetMatch (int armorSlot, int type, bool male, ref int equipSlot, ref bool robes)
 Calls EquipTexture.SetMatch, then all GlobalItem.SetMatch hooks.
 
static bool CanRightClick (Item item)
 Calls ModItem.CanRightClick, then all GlobalItem.CanRightClick hooks, until one of the returns true. Also returns true if ItemID.Sets.OpenableBag.
 
static void RightClick (Item item, Player player)
 
static void ModifyItemLoot (Item item, ItemLoot itemLoot)
 Calls each GlobalItem.ModifyItemLoot hooks.
 
static bool CanStack (Item destination, Item source)
 Returns false if item prefixes don't match. Then calls all GlobalItem.CanStack hooks until one returns false then ModItem.CanStack. Returns whether any of the hooks returned false.
 
static bool CanStackInWorld (Item destination, Item source)
 Calls all GlobalItem.CanStackInWorld hooks until one returns false then ModItem.CanStackInWorld. Returns whether any of the hooks returned false.
 
static bool TryStackItems (Item destination, Item source, out int numTransferred, bool infiniteSource=false)
 Stacks source onto destination if CanStack permits the transfer.
 
static void StackItems (Item destination, Item source, out int numTransferred, bool infiniteSource=false, int? numToTransfer=null)
 Stacks destination onto source
This method should not be called unless M:Terraria.ModLoader.ItemLoader.CanStack(Terraria.Item,Terraria.Item) returns true. See: M:Terraria.ModLoader.ItemLoader.TryStackItems(Terraria.Item,Terraria.Item,System.Int32@,System.Boolean)
 
static void OnStack (Item destination, Item source, int numToTransfer)
 Calls the GlobalItem.OnStack hooks in destination , then the ModItem.OnStack hook in destination
OnStack is called before the items are transferred from source to destination
 
static Item TransferWithLimit (Item source, int limit)
 Extract up to limit items from source . If some items remain, M:Terraria.ModLoader.ItemLoader.SplitStack(Terraria.Item,Terraria.Item,System.Int32) will be used.
 
static void SplitStack (Item destination, Item source, int numToTransfer)
 Called when splitting a stack of items.
 
static bool ReforgePrice (Item item, ref int reforgePrice, ref bool canApplyDiscount)
 Call all ModItem.ReforgePrice, then GlobalItem.ReforgePrice hooks.
 
static bool CanReforge (Item item)
 Calls ModItem.CanReforge, then all GlobalItem.CanReforge hooks. If any return false then false is returned.
 
static void PreReforge (Item item)
 Calls ModItem.PreReforge, then all GlobalItem.PreReforge hooks.
 
static void PostReforge (Item item)
 Calls ModItem.PostReforge, then all GlobalItem.PostReforge hooks.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static void Update (Item item, ref float gravity, ref float maxFallSpeed)
 Calls ModItem.Update, then all GlobalItem.Update hooks.
 
static void PostUpdate (Item item)
 Calls ModItem.PostUpdate and all GlobalItem.PostUpdate hooks.
 
static void GrabRange (Item item, Player player, ref int grabRange)
 Calls ModItem.GrabRange, then all GlobalItem.GrabRange hooks.
 
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.
 
static bool CanPickup (Item item, Player player)
 
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.
 
static bool ItemSpace (Item item, Player player)
 
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.
 
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.
 
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.
 
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.
 
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.
 
static void HoldoutOffset (float gravDir, int type, ref Vector2 offset)
 
static void HoldoutOrigin (Player player, ref Vector2 origin)
 
static bool CanEquipAccessory (Item item, int slot, bool modded)
 
static bool CanAccessoryBeEquippedWith (Item equippedItem, Item incomingItem)
 
static void ExtractinatorUse (ref int resultType, ref int resultStack, int extractType, int extractinatorBlockType)
 
static void CaughtFishStack (Item item)
 
static void IsAnglerQuestAvailable (int itemID, ref bool notAvailable)
 
static string AnglerChat (int type)
 
static bool PreDrawTooltip (Item item, ReadOnlyCollection< TooltipLine > lines, ref int x, ref int y)
 
static void PostDrawTooltip (Item item, ReadOnlyCollection< DrawableTooltipLine > lines)
 
static bool PreDrawTooltipLine (Item item, DrawableTooltipLine line, ref int yOffset)
 
static void PostDrawTooltipLine (Item item, DrawableTooltipLine line)
 
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, int prefixlineIndex)
 

Static Package Functions

static int Register (ModItem item)
 
static void ResizeArrays (bool unloading)
 
static void FinishSetup ()
 
static void ValidateDropsSet ()
 
static void Unload ()
 
static bool IsModItem (int index)
 
static bool MeleePrefix (Item item)
 
static bool WeaponPrefix (Item item)
 
static bool RangedPrefix (Item item)
 
static bool MagicPrefix (Item item)
 
static void SetDefaults (Item item, bool createModItem=true)
 
static void OnSpawn (Item item, IEntitySource source)
 
static void RightClickCallHooks (Item item, Player player)
 
static bool NeedsModSaving (Item item)
 

Static Package Attributes

static readonly int vanillaQuestFishCount = 41
 
static GlobalHookList< GlobalItemHookSaveData = AddHook((Expression<Func<GlobalItem, Action<Item, TagCompound>>>)((GlobalItem g) => g.SaveData))
 
static GlobalHookList< GlobalItemHookNetSend = AddHook((Expression<Func<GlobalItem, Action<Item, BinaryWriter>>>)((GlobalItem g) => g.NetSend))
 
static GlobalHookList< GlobalItemHookNetReceive = AddHook((Expression<Func<GlobalItem, Action<Item, BinaryReader>>>)((GlobalItem g) => g.NetReceive))
 

Properties

static int ItemCount = ItemID.Count [get, private set]
 

Private Member Functions

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 DelegateModifyManaCost (Item item, Player player, ref float reduce, ref float mult)
 
delegate? bool DelegateCanConsumeBait (Player baiter, Item bait)
 
delegate void DelegateModifyResearchSorting (Item item, ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
 
delegate bool DelegateCanResearch (Item item)
 
delegate void DelegateOnResearched (Item item, bool fullyResearched)
 
delegate void DelegateModifyWeaponDamage (Item item, Player player, ref StatModifier damage)
 
delegate void DelegateModifyWeaponKnockback (Item item, Player player, ref StatModifier knockback)
 
delegate void DelegateModifyWeaponCrit (Item item, Player player, ref float crit)
 
delegate void DelegatePickAmmo (Item weapon, Item ammo, Player player, ref int type, ref float speed, ref StatModifier damage, ref float knockback)
 
delegate void DelegateModifyShootStats (Item item, Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockBack)
 
delegate void DelegateUseItemHitbox (Item item, Player player, ref Rectangle hitbox, ref bool noHitbox)
 
delegate void DelegateModifyItemScale (Item item, Player player, ref float scale)
 
delegate void DelegateModifyHitNPC (Item item, Player player, NPC target, ref NPC.HitModifiers modifiers)
 
delegate void DelegateModifyHitPvp (Item item, Player player, Player target, ref Player.HurtModifiers modifiers)
 
delegate void DelegateSetMatch (int armorSlot, int type, bool male, ref int equipSlot, ref bool robes)
 
delegate bool DelegateReforgePrice (Item item, ref int reforgePrice, ref bool canApplyDiscount)
 
delegate void DelegateDrawArmorColor (EquipType type, int slot, Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
 
delegate void DelegateArmorArmGlowMask (int slot, Player drawPlayer, float shadow, ref int glowMask, ref Color color)
 
delegate void DelegateVerticalWingSpeeds (Item item, Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
 
delegate void DelegateHorizontalWingSpeeds (Item item, Player player, ref float speed, ref float acceleration)
 
delegate void DelegateUpdate (Item item, ref float gravity, ref float maxFallSpeed)
 
delegate void DelegateGrabRange (Item item, Player player, ref int grabRange)
 
delegate bool DelegatePreDrawInWorld (Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
 
delegate void DelegateExtractinatorUse (int extractType, int extractinatorBlockType, ref int resultType, ref int resultStack)
 
delegate void DelegateCaughtFishStack (int type, ref int stack)
 
delegate void DelegateAnglerChat (int type, ref string chat, ref string catchLocation)
 
delegate bool DelegatePreDrawTooltip (Item item, ReadOnlyCollection< TooltipLine > lines, ref int x, ref int y)
 
delegate void DelegatePostDrawTooltip (Item item, ReadOnlyCollection< DrawableTooltipLine > lines)
 
delegate bool DelegatePreDrawTooltipLine (Item item, DrawableTooltipLine line, ref int yOffset)
 
delegate void DelegatePostDrawTooltipLine (Item item, DrawableTooltipLine line)
 

Static Private Member Functions

static GlobalHookList< GlobalItemAddHook< F > (Expression< Func< GlobalItem, F > > func)
 
static void UpdateHookLists ()
 
static bool CanAccessoryBeEquippedWith (Item equippedItem, Item incomingItem, Player player)
 

Static Private Attributes

static readonly IList< ModItemitems = new List<ModItem>()
 
static readonly List< GlobalHookList< GlobalItem > > hooks = new List<GlobalHookList<GlobalItem>>()
 
static readonly List< GlobalHookList< GlobalItem > > modHooks = new List<GlobalHookList<GlobalItem>>()
 
static GlobalHookList< GlobalItemHookOnSpawn = AddHook((Expression<Func<GlobalItem, Action<Item, IEntitySource>>>)((GlobalItem g) => g.OnSpawn))
 
static GlobalHookList< GlobalItemHookOnCreate = AddHook((Expression<Func<GlobalItem, Action<Item, ItemCreationContext>>>)((GlobalItem g) => g.OnCreated))
 
static GlobalHookList< GlobalItemHookChoosePrefix = AddHook((Expression<Func<GlobalItem, Func<Item, UnifiedRandom, int>>>)((GlobalItem g) => g.ChoosePrefix))
 
static GlobalHookList< GlobalItemHookPrefixChance = AddHook((Expression<Func<GlobalItem, Func<Item, int, UnifiedRandom, bool?>>>)((GlobalItem g) => g.PrefixChance))
 
static GlobalHookList< GlobalItemHookAllowPrefix = AddHook((Expression<Func<GlobalItem, Func<Item, int, bool>>>)((GlobalItem g) => g.AllowPrefix))
 
static GlobalHookList< GlobalItemHookCanUseItem = AddHook((Expression<Func<GlobalItem, Func<Item, Player, bool>>>)((GlobalItem g) => g.CanUseItem))
 
static GlobalHookList< GlobalItemHookCanAutoReuseItem = AddHook((Expression<Func<GlobalItem, Func<Item, Player, bool?>>>)((GlobalItem g) => g.CanAutoReuseItem))
 
static GlobalHookList< GlobalItemHookUseStyle = AddHook((Expression<Func<GlobalItem, Action<Item, Player, Rectangle>>>)((GlobalItem g) => g.UseStyle))
 
static GlobalHookList< GlobalItemHookHoldStyle = AddHook((Expression<Func<GlobalItem, Action<Item, Player, Rectangle>>>)((GlobalItem g) => g.HoldStyle))
 
static GlobalHookList< GlobalItemHookHoldItem = AddHook((Expression<Func<GlobalItem, Action<Item, Player>>>)((GlobalItem g) => g.HoldItem))
 
static GlobalHookList< GlobalItemHookUseTimeMultiplier = AddHook((Expression<Func<GlobalItem, Func<Item, Player, float>>>)((GlobalItem g) => g.UseTimeMultiplier))
 
static GlobalHookList< GlobalItemHookUseAnimationMultiplier = AddHook((Expression<Func<GlobalItem, Func<Item, Player, float>>>)((GlobalItem g) => g.UseAnimationMultiplier))
 
static GlobalHookList< GlobalItemHookUseSpeedMultiplier = AddHook((Expression<Func<GlobalItem, Func<Item, Player, float>>>)((GlobalItem g) => g.UseSpeedMultiplier))
 
static GlobalHookList< GlobalItemHookGetHealLife = AddHook((Expression<Func<GlobalItem, DelegateGetHealLife>>)((GlobalItem g) => g.GetHealLife))
 
static GlobalHookList< GlobalItemHookGetHealMana = AddHook((Expression<Func<GlobalItem, DelegateGetHealMana>>)((GlobalItem g) => g.GetHealMana))
 
static GlobalHookList< GlobalItemHookModifyManaCost = AddHook((Expression<Func<GlobalItem, DelegateModifyManaCost>>)((GlobalItem g) => g.ModifyManaCost))
 
static GlobalHookList< GlobalItemHookOnMissingMana = AddHook((Expression<Func<GlobalItem, Action<Item, Player, int>>>)((GlobalItem g) => g.OnMissingMana))
 
static GlobalHookList< GlobalItemHookOnConsumeMana = AddHook((Expression<Func<GlobalItem, Action<Item, Player, int>>>)((GlobalItem g) => g.OnConsumeMana))
 
static GlobalHookList< GlobalItemHookCanConsumeBait = AddHook((Expression<Func<GlobalItem, DelegateCanConsumeBait>>)((GlobalItem g) => g.CanConsumeBait))
 
static GlobalHookList< GlobalItemHookModifyResearchSorting = AddHook((Expression<Func<GlobalItem, DelegateModifyResearchSorting>>)((GlobalItem g) => g.ModifyResearchSorting))
 
static GlobalHookList< GlobalItemHookCanResearch = AddHook((Expression<Func<GlobalItem, DelegateCanResearch>>)((GlobalItem g) => g.CanResearch))
 
static GlobalHookList< GlobalItemHookOnResearched = AddHook((Expression<Func<GlobalItem, DelegateOnResearched>>)((GlobalItem g) => g.OnResearched))
 
static GlobalHookList< GlobalItemHookModifyWeaponDamage = AddHook((Expression<Func<GlobalItem, DelegateModifyWeaponDamage>>)((GlobalItem g) => g.ModifyWeaponDamage))
 
static GlobalHookList< GlobalItemHookModifyWeaponKnockback = AddHook((Expression<Func<GlobalItem, DelegateModifyWeaponKnockback>>)((GlobalItem g) => g.ModifyWeaponKnockback))
 
static GlobalHookList< GlobalItemHookModifyWeaponCrit = AddHook((Expression<Func<GlobalItem, DelegateModifyWeaponCrit>>)((GlobalItem g) => g.ModifyWeaponCrit))
 
static GlobalHookList< GlobalItemHookNeedsAmmo = AddHook((Expression<Func<GlobalItem, Func<Item, Player, bool>>>)((GlobalItem g) => g.NeedsAmmo))
 
static GlobalHookList< GlobalItemHookPickAmmo = AddHook((Expression<Func<GlobalItem, DelegatePickAmmo>>)((GlobalItem g) => g.PickAmmo))
 
static GlobalHookList< GlobalItemHookCanChooseAmmo = AddHook((Expression<Func<GlobalItem, Func<Item, Item, Player, bool?>>>)((GlobalItem g) => g.CanChooseAmmo))
 
static GlobalHookList< GlobalItemHookCanBeChosenAsAmmo = AddHook((Expression<Func<GlobalItem, Func<Item, Item, Player, bool?>>>)((GlobalItem g) => g.CanBeChosenAsAmmo))
 
static GlobalHookList< GlobalItemHookCanConsumeAmmo = AddHook((Expression<Func<GlobalItem, Func<Item, Item, Player, bool>>>)((GlobalItem g) => g.CanConsumeAmmo))
 
static GlobalHookList< GlobalItemHookCanBeConsumedAsAmmo = AddHook((Expression<Func<GlobalItem, Func<Item, Item, Player, bool>>>)((GlobalItem g) => g.CanBeConsumedAsAmmo))
 
static GlobalHookList< GlobalItemHookOnConsumeAmmo = AddHook((Expression<Func<GlobalItem, Action<Item, Item, Player>>>)((GlobalItem g) => g.OnConsumeAmmo))
 
static GlobalHookList< GlobalItemHookOnConsumedAsAmmo = AddHook((Expression<Func<GlobalItem, Action<Item, Item, Player>>>)((GlobalItem g) => g.OnConsumedAsAmmo))
 
static GlobalHookList< GlobalItemHookCanShoot = AddHook((Expression<Func<GlobalItem, Func<Item, Player, bool>>>)((GlobalItem g) => g.CanShoot))
 
static GlobalHookList< GlobalItemHookModifyShootStats = AddHook((Expression<Func<GlobalItem, DelegateModifyShootStats>>)((GlobalItem g) => g.ModifyShootStats))
 
static GlobalHookList< GlobalItemHookShoot = AddHook((Expression<Func<GlobalItem, Func<Item, Player, EntitySource_ItemUse_WithAmmo, Vector2, Vector2, int, int, float, bool>>>)((GlobalItem g) => g.Shoot))
 
static GlobalHookList< GlobalItemHookUseItemHitbox = AddHook((Expression<Func<GlobalItem, DelegateUseItemHitbox>>)((GlobalItem g) => g.UseItemHitbox))
 
static GlobalHookList< GlobalItemHookMeleeEffects = AddHook((Expression<Func<GlobalItem, Action<Item, Player, Rectangle>>>)((GlobalItem g) => g.MeleeEffects))
 
static GlobalHookList< GlobalItemHookCanCatchNPC = AddHook((Expression<Func<GlobalItem, Func<Item, NPC, Player, bool?>>>)((GlobalItem g) => g.CanCatchNPC))
 
static GlobalHookList< GlobalItemHookOnCatchNPC = AddHook((Expression<Func<GlobalItem, Action<Item, NPC, Player, bool>>>)((GlobalItem g) => g.OnCatchNPC))
 
static GlobalHookList< GlobalItemHookModifyItemScale = AddHook((Expression<Func<GlobalItem, DelegateModifyItemScale>>)((GlobalItem g) => g.ModifyItemScale))
 
static GlobalHookList< GlobalItemHookCanHitNPC = AddHook((Expression<Func<GlobalItem, Func<Item, Player, NPC, bool?>>>)((GlobalItem g) => g.CanHitNPC))
 
static GlobalHookList< GlobalItemHookCanCollideNPC = AddHook((Expression<Func<GlobalItem, Func<Item, Rectangle, Player, NPC, bool?>>>)((GlobalItem g) => g.CanMeleeAttackCollideWithNPC))
 
static GlobalHookList< GlobalItemHookModifyHitNPC = AddHook((Expression<Func<GlobalItem, DelegateModifyHitNPC>>)((GlobalItem g) => g.ModifyHitNPC))
 
static GlobalHookList< GlobalItemHookOnHitNPC = AddHook((Expression<Func<GlobalItem, Action<Item, Player, NPC, NPC.HitInfo, int>>>)((GlobalItem g) => g.OnHitNPC))
 
static GlobalHookList< GlobalItemHookCanHitPvp = AddHook((Expression<Func<GlobalItem, Func<Item, Player, Player, bool>>>)((GlobalItem g) => g.CanHitPvp))
 
static GlobalHookList< GlobalItemHookModifyHitPvp = AddHook((Expression<Func<GlobalItem, DelegateModifyHitPvp>>)((GlobalItem g) => g.ModifyHitPvp))
 
static GlobalHookList< GlobalItemHookOnHitPvp = AddHook((Expression<Func<GlobalItem, Action<Item, Player, Player, Player.HurtInfo>>>)((GlobalItem g) => g.OnHitPvp))
 
static GlobalHookList< GlobalItemHookUseItem = AddHook((Expression<Func<GlobalItem, Func<Item, Player, bool?>>>)((GlobalItem g) => g.UseItem))
 
static GlobalHookList< GlobalItemHookUseAnimation = AddHook((Expression<Func<GlobalItem, Action<Item, Player>>>)((GlobalItem g) => g.UseAnimation))
 
static GlobalHookList< GlobalItemHookConsumeItem = AddHook((Expression<Func<GlobalItem, Func<Item, Player, bool>>>)((GlobalItem g) => g.ConsumeItem))
 
static GlobalHookList< GlobalItemHookOnConsumeItem = AddHook((Expression<Func<GlobalItem, Action<Item, Player>>>)((GlobalItem g) => g.OnConsumeItem))
 
static GlobalHookList< GlobalItemHookUseItemFrame = AddHook((Expression<Func<GlobalItem, Action<Item, Player>>>)((GlobalItem g) => g.UseItemFrame))
 
static GlobalHookList< GlobalItemHookHoldItemFrame = AddHook((Expression<Func<GlobalItem, Action<Item, Player>>>)((GlobalItem g) => g.HoldItemFrame))
 
static GlobalHookList< GlobalItemHookAltFunctionUse = AddHook((Expression<Func<GlobalItem, Func<Item, Player, bool>>>)((GlobalItem g) => g.AltFunctionUse))
 
static GlobalHookList< GlobalItemHookUpdateInventory = AddHook((Expression<Func<GlobalItem, Action<Item, Player>>>)((GlobalItem g) => g.UpdateInventory))
 
static GlobalHookList< GlobalItemHookUpdateInfoAccessory = AddHook((Expression<Func<GlobalItem, Action<Item, Player>>>)((GlobalItem g) => g.UpdateInfoAccessory))
 
static GlobalHookList< GlobalItemHookUpdateEquip = AddHook((Expression<Func<GlobalItem, Action<Item, Player>>>)((GlobalItem g) => g.UpdateEquip))
 
static GlobalHookList< GlobalItemHookUpdateAccessory = AddHook((Expression<Func<GlobalItem, Action<Item, Player, bool>>>)((GlobalItem g) => g.UpdateAccessory))
 
static GlobalHookList< GlobalItemHookUpdateVanity = AddHook((Expression<Func<GlobalItem, Action<Item, Player>>>)((GlobalItem g) => g.UpdateVanity))
 
static GlobalHookList< GlobalItemHookUpdateArmorSet = AddHook((Expression<Func<GlobalItem, Action<Player, string>>>)((GlobalItem g) => g.UpdateArmorSet))
 
static GlobalHookList< GlobalItemHookPreUpdateVanitySet = AddHook((Expression<Func<GlobalItem, Action<Player, string>>>)((GlobalItem g) => g.PreUpdateVanitySet))
 
static GlobalHookList< GlobalItemHookUpdateVanitySet = AddHook((Expression<Func<GlobalItem, Action<Player, string>>>)((GlobalItem g) => g.UpdateVanitySet))
 
static GlobalHookList< GlobalItemHookArmorSetShadows = AddHook((Expression<Func<GlobalItem, Action<Player, string>>>)((GlobalItem g) => g.ArmorSetShadows))
 
static GlobalHookList< GlobalItemHookSetMatch = AddHook((Expression<Func<GlobalItem, DelegateSetMatch>>)((GlobalItem g) => g.SetMatch))
 
static GlobalHookList< GlobalItemHookCanRightClick = AddHook((Expression<Func<GlobalItem, Func<Item, bool>>>)((GlobalItem g) => g.CanRightClick))
 
static GlobalHookList< GlobalItemHookRightClick = AddHook((Expression<Func<GlobalItem, Action<Item, Player>>>)((GlobalItem g) => g.RightClick))
 
static GlobalHookList< GlobalItemHookModifyItemLoot = AddHook((Expression<Func<GlobalItem, Action<Item, ItemLoot>>>)((GlobalItem g) => g.ModifyItemLoot))
 
static GlobalHookList< GlobalItemHookCanStack = AddHook((Expression<Func<GlobalItem, Func<Item, Item, bool>>>)((GlobalItem g) => g.CanStack))
 
static GlobalHookList< GlobalItemHookCanStackInWorld = AddHook((Expression<Func<GlobalItem, Func<Item, Item, bool>>>)((GlobalItem g) => g.CanStackInWorld))
 
static GlobalHookList< GlobalItemHookOnStack = AddHook((Expression<Func<GlobalItem, Action<Item, Item, int>>>)((GlobalItem g) => g.OnStack))
 
static GlobalHookList< GlobalItemHookSplitStack = AddHook((Expression<Func<GlobalItem, Action<Item, Item, int>>>)((GlobalItem g) => g.SplitStack))
 
static GlobalHookList< GlobalItemHookReforgePrice = AddHook((Expression<Func<GlobalItem, DelegateReforgePrice>>)((GlobalItem g) => g.ReforgePrice))
 
static GlobalHookList< GlobalItemHookCanReforge = AddHook((Expression<Func<GlobalItem, Func<Item, bool>>>)((GlobalItem g) => g.CanReforge))
 
static GlobalHookList< GlobalItemHookPreReforge = AddHook((Expression<Func<GlobalItem, Action<Item>>>)((GlobalItem g) => g.PreReforge))
 
static GlobalHookList< GlobalItemHookPostReforge = AddHook((Expression<Func<GlobalItem, Action<Item>>>)((GlobalItem g) => g.PostReforge))
 
static GlobalHookList< GlobalItemHookDrawArmorColor = AddHook((Expression<Func<GlobalItem, DelegateDrawArmorColor>>)((GlobalItem g) => g.DrawArmorColor))
 
static GlobalHookList< GlobalItemHookArmorArmGlowMask = AddHook((Expression<Func<GlobalItem, DelegateArmorArmGlowMask>>)((GlobalItem g) => g.ArmorArmGlowMask))
 
static GlobalHookList< GlobalItemHookVerticalWingSpeeds = AddHook((Expression<Func<GlobalItem, DelegateVerticalWingSpeeds>>)((GlobalItem g) => g.VerticalWingSpeeds))
 
static GlobalHookList< GlobalItemHookHorizontalWingSpeeds = AddHook((Expression<Func<GlobalItem, DelegateHorizontalWingSpeeds>>)((GlobalItem g) => g.HorizontalWingSpeeds))
 
static GlobalHookList< GlobalItemHookWingUpdate = AddHook((Expression<Func<GlobalItem, Func<int, Player, bool, bool>>>)((GlobalItem g) => g.WingUpdate))
 
static GlobalHookList< GlobalItemHookUpdate = AddHook((Expression<Func<GlobalItem, DelegateUpdate>>)((GlobalItem g) => g.Update))
 
static GlobalHookList< GlobalItemHookPostUpdate = AddHook((Expression<Func<GlobalItem, Action<Item>>>)((GlobalItem g) => g.PostUpdate))
 
static GlobalHookList< GlobalItemHookGrabRange = AddHook((Expression<Func<GlobalItem, DelegateGrabRange>>)((GlobalItem g) => g.GrabRange))
 
static GlobalHookList< GlobalItemHookGrabStyle = AddHook((Expression<Func<GlobalItem, Func<Item, Player, bool>>>)((GlobalItem g) => g.GrabStyle))
 
static GlobalHookList< GlobalItemHookCanPickup = AddHook((Expression<Func<GlobalItem, Func<Item, Player, bool>>>)((GlobalItem g) => g.CanPickup))
 
static GlobalHookList< GlobalItemHookOnPickup = AddHook((Expression<Func<GlobalItem, Func<Item, Player, bool>>>)((GlobalItem g) => g.OnPickup))
 
static GlobalHookList< GlobalItemHookItemSpace = AddHook((Expression<Func<GlobalItem, Func<Item, Player, bool>>>)((GlobalItem g) => g.ItemSpace))
 
static GlobalHookList< GlobalItemHookGetAlpha = AddHook((Expression<Func<GlobalItem, Func<Item, Color, Color?>>>)((GlobalItem g) => g.GetAlpha))
 
static GlobalHookList< GlobalItemHookPreDrawInWorld = AddHook((Expression<Func<GlobalItem, DelegatePreDrawInWorld>>)((GlobalItem g) => g.PreDrawInWorld))
 
static GlobalHookList< GlobalItemHookPostDrawInWorld = AddHook((Expression<Func<GlobalItem, Action<Item, SpriteBatch, Color, Color, float, float, int>>>)((GlobalItem g) => g.PostDrawInWorld))
 
static GlobalHookList< GlobalItemHookPreDrawInInventory = AddHook((Expression<Func<GlobalItem, Func<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float, bool>>>)((GlobalItem g) => g.PreDrawInInventory))
 
static GlobalHookList< GlobalItemHookPostDrawInInventory = AddHook((Expression<Func<GlobalItem, Action<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float>>>)((GlobalItem g) => g.PostDrawInInventory))
 
static GlobalHookList< GlobalItemHookHoldoutOffset = AddHook((Expression<Func<GlobalItem, Func<int, Vector2?>>>)((GlobalItem g) => g.HoldoutOffset))
 
static GlobalHookList< GlobalItemHookHoldoutOrigin = AddHook((Expression<Func<GlobalItem, Func<int, Vector2?>>>)((GlobalItem g) => g.HoldoutOrigin))
 
static GlobalHookList< GlobalItemHookCanEquipAccessory = AddHook((Expression<Func<GlobalItem, Func<Item, Player, int, bool, bool>>>)((GlobalItem g) => g.CanEquipAccessory))
 
static GlobalHookList< GlobalItemHookCanAccessoryBeEquippedWith = AddHook((Expression<Func<GlobalItem, Func<Item, Item, Player, bool>>>)((GlobalItem g) => g.CanAccessoryBeEquippedWith))
 
static GlobalHookList< GlobalItemHookExtractinatorUse = AddHook((Expression<Func<GlobalItem, DelegateExtractinatorUse>>)((GlobalItem g) => g.ExtractinatorUse))
 
static GlobalHookList< GlobalItemHookCaughtFishStack = AddHook((Expression<Func<GlobalItem, DelegateCaughtFishStack>>)((GlobalItem g) => g.CaughtFishStack))
 
static GlobalHookList< GlobalItemHookIsAnglerQuestAvailable = AddHook((Expression<Func<GlobalItem, Func<int, bool>>>)((GlobalItem g) => g.IsAnglerQuestAvailable))
 
static GlobalHookList< GlobalItemHookAnglerChat = AddHook((Expression<Func<GlobalItem, DelegateAnglerChat>>)((GlobalItem g) => g.AnglerChat))
 
static GlobalHookList< GlobalItemHookPreDrawTooltip = AddHook((Expression<Func<GlobalItem, DelegatePreDrawTooltip>>)((GlobalItem g) => g.PreDrawTooltip))
 
static GlobalHookList< GlobalItemHookPostDrawTooltip = AddHook((Expression<Func<GlobalItem, DelegatePostDrawTooltip>>)((GlobalItem g) => g.PostDrawTooltip))
 
static GlobalHookList< GlobalItemHookPreDrawTooltipLine = AddHook((Expression<Func<GlobalItem, DelegatePreDrawTooltipLine>>)((GlobalItem g) => g.PreDrawTooltipLine))
 
static GlobalHookList< GlobalItemHookPostDrawTooltipLine = AddHook((Expression<Func<GlobalItem, DelegatePostDrawTooltipLine>>)((GlobalItem g) => g.PostDrawTooltipLine))
 
static GlobalHookList< GlobalItemHookModifyTooltips = AddHook((Expression<Func<GlobalItem, Action<Item, List<TooltipLine>>>>)((GlobalItem g) => g.ModifyTooltips))
 

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


The documentation for this class was generated from the following file: