Fix duplicate items shown in Utils.GetItemByName
* Remove unused usings
This commit is contained in:
parent
5890cb4a88
commit
a026c5809f
1 changed files with 8 additions and 3 deletions
|
|
@ -17,21 +17,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Utilities;
|
||||
using TShockAPI.DB;
|
||||
using BCrypt.Net;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.Localization;
|
||||
using TShockAPI.Localization;
|
||||
|
||||
namespace TShockAPI
|
||||
|
|
@ -346,6 +344,8 @@ namespace TShockAPI
|
|||
var found = new List<Item>();
|
||||
Item item = new Item();
|
||||
string nameLower = name.ToLowerInvariant();
|
||||
var checkEnglish = Language.ActiveCulture != GameCulture.English;
|
||||
|
||||
for (int i = -48; i < Main.maxItemTypes; i++)
|
||||
{
|
||||
item.netDefaults(i);
|
||||
|
|
@ -357,6 +357,11 @@ namespace TShockAPI
|
|||
found.Add(item.Clone());
|
||||
}
|
||||
|
||||
if (!checkEnglish)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string englishName = EnglishLanguage.GetItemNameById(i).ToLowerInvariant();
|
||||
if (!String.IsNullOrEmpty(englishName))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue