Esempio n. 1
0
        internal static bool UpdateBegin(global::Terraria.Item item, ref int i)
        {
            var res = Hooks.Item.PreUpdate?.Invoke(item, ref i);

            if (res.HasValue)
            {
                return(res.Value == HookResult.Continue);
            }
            return(true);
        }
Esempio n. 2
0
        internal static bool QuickStack(int playerId, global::Terraria.Item item, int chestIndex)
        {
            var res = Hooks.Chest.QuickStack?.Invoke(playerId, item, chestIndex);

            if (res.HasValue)
            {
                return(res.Value == HookResult.Continue);
            }
            return(true);
        }
        internal static bool CheckMaterialBegin(global::Terraria.Item item, ref bool result)
        {
            var res = Hooks.Item.PreCheckMaterial?.Invoke(item, ref result);

            if (res.HasValue)
            {
                return(res.Value == HookResult.Continue);
            }
            return(true);
        }
        /// <summary>
        /// This method is injected into the start of the NetDefaults method.
        /// The return value will dictate if normal vanilla code should continue to run.
        /// </summary>
        /// <returns>True to continue on to vanilla code, otherwise false</returns>
        internal static bool NetDefaultsBegin(global::Terraria.Item item, ref int type)
        {
            var res = Hooks.Item.PreNetDefaults?.Invoke(item, ref type);

            if (res.HasValue)
            {
                return(res.Value == HookResult.Continue);
            }
            return(true);
        }
Esempio n. 5
0
        /// <summary>
        /// This method is injected into the start of the SetDefaults(string) method.
        /// The return value will dictate if normal vanilla code should continue to run.
        /// </summary>
        /// <returns>True to continue on to vanilla code, otherwise false</returns>
        internal static bool SetDefaultsByNameBegin(global::Terraria.Item item, ref string itemName)
        {
            var res = Hooks.Item.PreSetDefaultsByName?.Invoke(item, ref itemName);

            if (res.HasValue)
            {
                return(res.Value == HookResult.Continue);
            }
            return(true);
        }
Esempio n. 6
0
        /// <summary>
        /// This method is injected into the start of the SetDefaults(int,bool) method.
        /// The return value will dictate if normal vanilla code should continue to run.
        /// </summary>
        /// <returns>True to continue on to vanilla code, otherwise false</returns>
        internal static bool SetDefaultsByIdBegin(global::Terraria.Item item, ref int type, ref bool noMatCheck)
        {
            var res = Hooks.Item.PreSetDefaultsById?.Invoke(item, ref type, ref noMatCheck);

            if (res.HasValue)
            {
                return(res.Value == HookResult.Continue);
            }
            return(true);
        }
Esempio n. 7
0
 internal static void UpdateEnd(global::Terraria.Item item, int i) => Hooks.Item.PostUpdate?.Invoke(item, i);
 /// <summary>
 /// This method is injected into the end of the NetDefaults method.
 /// </summary>
 internal static void NetDefaultsEnd(global::Terraria.Item item, ref int type) =>
 Hooks.Item.PostNetDefaults?.Invoke(item, ref type);
Esempio n. 9
0
 /// <summary>
 /// This method is injected into the end of the SetDefaults(string) method.
 /// </summary>
 internal static void SetDefaultsByNameEnd(global::Terraria.Item item, ref string itemName) =>
 Hooks.Item.PostSetDefaultsByName?.Invoke(item, ref itemName);
Esempio n. 10
0
 /// <summary>
 /// This method is injected into the end of the SetDefaults(int,bool) method.
 /// </summary>
 internal static void SetDefaultsByIdEnd(global::Terraria.Item item, ref int type, ref bool noMatCheck) =>
 Hooks.Item.PostSetDefaultsById?.Invoke(item, ref type, ref noMatCheck);