Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
Beispiel #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);
Beispiel #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);