/// <summary> /// Reduces a world item's stack. /// </summary> /// <param name="idx">Index (`whoAmI`) of item in `Main.item`.</param> /// <param name="amt"></param> public static void ReduceWorldItemStack(int idx, int amt) { Item item = Main.item[idx]; item.whoAmI = idx; //needed? ItemHelpers.ReduceStack(item, amt); }
/// <summary> /// Destroys a world item (ensures sync). /// </summary> /// <param name="idx"></param> public static void DestroyWorldItem(int idx) { Item item = Main.item[idx]; ItemHelpers.DestroyItem(item); if (Main.netMode == 2) // Server { NetMessage.SendData(MessageID.SyncItem, -1, -1, null, idx); } }