ItemLoader
This serves as the central class from which item-related functions are carried out. It also stores a list of mod items by ID.
Methods
- GetItem(System.Int32)()
- Gets the ModItem instance corresponding to the specified type. Returns null if no modded item has the given type.
- CanUseItem(Terraria.Item,Terraria.Player)()
- Returns the "and" operation on the results of ModItem.CanUseItem and all GlobalItem.CanUseItem hooks. Does not fail fast (every hook is called).
- UseStyle(Terraria.Item,Terraria.Player)()
- Calls ModItem.UseStyle and all GlobalItem.UseStyle hooks.
- HoldStyle(Terraria.Item,Terraria.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.
- HoldItem(Terraria.Item,Terraria.Player)()
- Calls ModItem.HoldItem and all GlobalItem.HoldItem hooks.
- GetHealLife(Terraria.Item,Terraria.Player,System.Boolean,System.Int32@)()
- Calls ModItem.GetHealLife, then all GlobalItem.GetHealLife hooks.
- GetHealMana(Terraria.Item,Terraria.Player,System.Boolean,System.Int32@)()
- Calls ModItem.GetHealMana, then all GlobalItem.GetHealMana hooks.
- GetWeaponDamage(Terraria.Item,Terraria.Player,System.Int32@)()
- Calls ModItem.GetWeaponDamage, then all GlobalItem.GetWeaponDamage hooks.
- GetWeaponKnockback(Terraria.Item,Terraria.Player,System.Single@)()
- Calls ModItem.GetWeaponKnockback, then all GlobalItem.GetWeaponKnockback hooks.
- GetWeaponCrit(Terraria.Item,Terraria.Player,System.Int32@)()
- Calls ModItem.GetWeaponCrit, then all GlobalItem.GetWeaponCrit hooks.
- CheckProjOnSwing(Terraria.Player,Terraria.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.
- PickAmmo(Terraria.Item,Terraria.Player,System.Int32@,System.Single@,System.Int32@,System.Single@)()
- Calls ModItem.PickAmmo, then all GlobalItem.PickAmmo hooks.
- ConsumeAmmo(Terraria.Item,Terraria.Item,Terraria.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.
- OnConsumeAmmo(Terraria.Item,Terraria.Item,Terraria.Player)()
- Calls ModItem.OnConsumeAmmo for the weapon, ModItem.OnConsumeAmmo for the ammo, then each GlobalItem.OnConsumeAmmo hook for the weapon and ammo.
- Shoot(Terraria.Item,Terraria.Player,Microsoft.Xna.Framework.Vector2@,System.Single@,System.Single@,System.Int32@,System.Int32@,System.Single@)()
- Calls each GlobalItem.Shoot hook, then ModItem.Shoot, until one of them returns false. If all of them return true, returns true.
- UseItemHitbox(Terraria.Item,Terraria.Player,Microsoft.Xna.Framework.Rectangle@,System.Boolean@)()
- Calls ModItem.UseItemHitbox, then all GlobalItem.UseItemHitbox hooks.
- MeleeEffects(Terraria.Item,Terraria.Player,Microsoft.Xna.Framework.Rectangle)()
- Calls ModItem.MeleeEffects and all GlobalItem.MeleeEffects hooks.
- CanHitNPC(Terraria.Item,Terraria.Player,Terraria.NPC)()
- 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.
- ModifyHitNPC(Terraria.Item,Terraria.Player,Terraria.NPC,System.Int32@,System.Single@,System.Boolean@)()
- Calls ModItem.ModifyHitNPC, then all GlobalItem.ModifyHitNPC hooks.
- OnHitNPC(Terraria.Item,Terraria.Player,Terraria.NPC,System.Int32,System.Single,System.Boolean)()
- Calls ModItem.OnHitNPC and all GlobalItem.OnHitNPC hooks.
- CanHitPvp(Terraria.Item,Terraria.Player,Terraria.Player)()
- Calls all GlobalItem.CanHitPvp hooks, then ModItem.CanHitPvp, until one of them returns false. If all of them return true, this returns true.
- ModifyHitPvp(Terraria.Item,Terraria.Player,Terraria.Player,System.Int32@,System.Boolean@)()
- Calls ModItem.ModifyHitPvp, then all GlobalItem.ModifyHitPvp hooks.
- OnHitPvp(Terraria.Item,Terraria.Player,Terraria.Player,System.Int32,System.Boolean)()
- Calls ModItem.OnHitPvp and all GlobalItem.OnHitPvp hooks.
- UseItem(Terraria.Item,Terraria.Player)()
- Returns true if any of ModItem.UseItem or GlobalItem.UseItem return true Does not fail fast (calls every hook)
- ConsumeItem(Terraria.Item,Terraria.Player)()
- If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to false.
- OnConsumeItem(Terraria.Item,Terraria.Player)()
- Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.
- UseItemFrame(Terraria.Item,Terraria.Player)()
- Calls ModItem.UseItemFrame, then all GlobalItem.UseItemFrame hooks, until one of them returns true. Returns whether any of the hooks returned true.
- HoldItemFrame(Terraria.Item,Terraria.Player)()
- Calls ModItem.HoldItemFrame, then all GlobalItem.HoldItemFrame hooks, until one of them returns true. Returns whether any of the hooks returned true.
- AltFunctionUse(Terraria.Item,Terraria.Player)()
- Calls ModItem.AltFunctionUse, then all GlobalItem.AltFunctionUse hooks, until one of them returns true. Returns whether any of the hooks returned true.
- UpdateInventory(Terraria.Item,Terraria.Player)()
- Calls ModItem.UpdateInventory and all GlobalItem.UpdateInventory hooks.
- UpdateEquip(Terraria.Item,Terraria.Player)()
- Calls ModItem.UpdateEquip and all GlobalItem.UpdateEquip hooks.
- UpdateAccessory(Terraria.Item,Terraria.Player,System.Boolean)()
- Calls ModItem.UpdateAccessory and all GlobalItem.UpdateAccessory hooks.
- UpdateVanity(Terraria.Player)()
- Calls each of the item's equipment texture's UpdateVanity hook.
- UpdateArmorSet(Terraria.Player,Terraria.Item,Terraria.Item,Terraria.Item)()
- 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.
- PreUpdateVanitySet(Terraria.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.
- UpdateVanitySet(Terraria.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.
- ArmorSetShadows(Terraria.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.
- SetMatch(System.Int32,System.Int32,System.Boolean,System.Int32@,System.Boolean@)()
- Calls EquipTexture.SetMatch, then all GlobalItem.SetMatch hooks.
- CanRightClick(Terraria.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.
- RightClick(Terraria.Item,Terraria.Player)()
- 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.
- IsModBossBag(Terraria.Item)()
- Returns whether ModItem.bossBagNPC is greater than 0. Returns false if item is not a modded item.
- OpenBossBag(System.Int32,Terraria.Player,System.Int32@)()
- If the item is a modded item and ModItem.bossBagNPC is greater than 0, calls ModItem.OpenBossBag and sets npc to ModItem.bossBagNPC.
- PreOpenVanillaBag(System.String,Terraria.Player,System.Int32)()
- Calls each GlobalItem.PreOpenVanillaBag hook until one of them returns false. Returns true if all of them returned true.
- OpenVanillaBag(System.String,Terraria.Player,System.Int32)()
- Calls all GlobalItem.OpenVanillaBag hooks.
- ReforgePrice(Terraria.Item,System.Int32@,System.Boolean@)()
- Call all ModItem.ReforgePrice, then GlobalItem.ReforgePrice hooks.
- PreReforge(Terraria.Item)()
- Calls ModItem.PreReforge, then all GlobalItem.PreReforge hooks.
- PostReforge(Terraria.Item)()
- Calls ModItem.PostReforge, then all GlobalItem.PostReforge hooks.
- DrawHands(Terraria.Player,System.Boolean@,System.Boolean@)()
- Calls the item's body equipment texture's DrawHands hook, then all GlobalItem.DrawHands hooks.
- DrawHair(Terraria.Player,System.Boolean@,System.Boolean@)()
- Calls the item's head equipment texture's DrawHair hook, then all GlobalItem.DrawHair hooks.
- DrawHead(Terraria.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.
- DrawBody(Terraria.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.
- DrawLegs(Terraria.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.
- DrawArmorColor(Terraria.ModLoader.EquipType,System.Int32,Terraria.Player,System.Single,Microsoft.Xna.Framework.Color@,System.Int32@,Microsoft.Xna.Framework.Color@)()
- Calls the item's equipment texture's DrawArmorColor hook, then all GlobalItem.DrawArmorColor hooks.
- ArmorArmGlowMask(System.Int32,Terraria.Player,System.Single,System.Int32@,Microsoft.Xna.Framework.Color@)()
- Calls the item's body equipment texture's ArmorArmGlowMask hook, then all GlobalItem.ArmorArmGlowMask hooks.
- GetWing(Terraria.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.
- VerticalWingSpeeds(Terraria.Player,System.Single@,System.Single@,System.Single@,System.Single@,System.Single@)()
- If the player is using wings, this uses the result of GetWing, and calls ModItem.VerticalWingSpeeds then all GlobalItem.VerticalWingSpeeds hooks.
- HorizontalWingSpeeds(Terraria.Player)()
- If the player is using wings, this uses the result of GetWing, and calls ModItem.HorizontalWingSpeeds then all GlobalItem.HorizontalWingSpeeds hooks.
- WingUpdate(Terraria.Player,System.Boolean)()
- If wings can be seen on the player, calls the player's wing's equipment texture's WingUpdate and all GlobalItem.WingUpdate hooks.
- Update(Terraria.Item,System.Single@,System.Single@)()
- Calls ModItem.Update, then all GlobalItem.Update hooks.
- PostUpdate(Terraria.Item)()
- Calls ModItem.PostUpdate and all GlobalItem.PostUpdate hooks.
- GrabRange(Terraria.Item,Terraria.Player,System.Int32@)()
- Calls ModItem.GrabRange, then all GlobalItem.GrabRange hooks.
- GrabStyle(Terraria.Item,Terraria.Player)()
- Calls all GlobalItem.GrabStyle hooks then ModItem.GrabStyle, until one of them returns true. Returns whether any of the hooks returned true.
- OnPickup(Terraria.Item,Terraria.Player)()
- Calls all GlobalItem.OnPickup hooks then ModItem.OnPickup, until one of the returns false. Returns true if all of the hooks return true.
- GetAlpha(Terraria.Item,Microsoft.Xna.Framework.Color)()
- 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.
- PreDrawInWorld(Terraria.Item,Microsoft.Xna.Framework.Graphics.SpriteBatch,Microsoft.Xna.Framework.Color,Microsoft.Xna.Framework.Color,System.Single@,System.Single@,System.Int32)()
- Returns the "and" operator on the results of ModItem.PreDrawInWorld and all GlobalItem.PreDrawInWorld hooks.
- PostDrawInWorld(Terraria.Item,Microsoft.Xna.Framework.Graphics.SpriteBatch,Microsoft.Xna.Framework.Color,Microsoft.Xna.Framework.Color,System.Single,System.Single,System.Int32)()
- Calls ModItem.PostDrawInWorld, then all GlobalItem.PostDrawInWorld hooks.
- PreDrawInInventory(Terraria.Item,Microsoft.Xna.Framework.Graphics.SpriteBatch,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Rectangle,Microsoft.Xna.Framework.Color,Microsoft.Xna.Framework.Color,Microsoft.Xna.Framework.Vector2,System.Single)()
- Returns the "and" operator on the results of all GlobalItem.PreDrawInInventory hooks and ModItem.PreDrawInInventory.
- PostDrawInInventory(Terraria.Item,Microsoft.Xna.Framework.Graphics.SpriteBatch,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Rectangle,Microsoft.Xna.Framework.Color,Microsoft.Xna.Framework.Color,Microsoft.Xna.Framework.Vector2,System.Single)()
- Calls ModItem.PostDrawInInventory, then all GlobalItem.PostDrawInInventory hooks.