7
7
import cat .nyaa .nyaacore .CommandReceiver ;
8
8
import cat .nyaa .nyaacore .LanguageRepository ;
9
9
import cat .nyaa .nyaacore .Message ;
10
- import cat .nyaa .nyaacore .utils .I18nUtils ;
11
10
import com .google .common .cache .Cache ;
12
11
import com .google .common .cache .CacheBuilder ;
13
12
import com .google .common .collect .ImmutableSet ;
14
13
import com .google .common .collect .LinkedListMultimap ;
14
+ import com .meowj .langutils .lang .LanguageHelper ;
15
15
import org .bukkit .Bukkit ;
16
16
import org .bukkit .ChatColor ;
17
17
import org .bukkit .Location ;
30
30
import java .util .stream .Collectors ;
31
31
import java .util .stream .Stream ;
32
32
33
- public class SearchCommands extends CommandReceiver < HamsterEcoHelper > {
33
+ public class SearchCommands extends CommandReceiver {
34
34
private Cache <UUID , List <Map .Entry <SignShop , ShopItem >>> searchResult =
35
35
CacheBuilder .newBuilder ()
36
36
.concurrencyLevel (2 )
@@ -186,8 +186,8 @@ && distance(curLoc, sign) < rangeLimit)) {
186
186
enchMatch = enchants .entrySet ()
187
187
.stream ().flatMap (enchEntry ->
188
188
Stream .of (
189
- I18nUtils .getEnchantmentDisplayName (enchEntry , "zh_cn" ),
190
- I18nUtils .getEnchantmentDisplayName (enchEntry , "en_us" )
189
+ LanguageHelper .getEnchantmentDisplayName (enchEntry , "zh_cn" ),
190
+ LanguageHelper .getEnchantmentDisplayName (enchEntry , "en_us" )
191
191
)
192
192
)
193
193
.map (ChatColor ::stripColor )
@@ -196,8 +196,8 @@ && distance(curLoc, sign) < rangeLimit)) {
196
196
if (enchMatch ) return true ;
197
197
}
198
198
if (matchEnchOnly ) return false ;
199
- String zhName = ChatColor .stripColor (I18nUtils .getItemDisplayName (stack , "zh_cn" )).toLowerCase ();
200
- String enName = ChatColor .stripColor (I18nUtils .getItemDisplayName (stack , "en_us" )).toLowerCase ();
199
+ String zhName = ChatColor .stripColor (LanguageHelper .getItemDisplayName (stack , "zh_cn" )).toLowerCase ();
200
+ String enName = ChatColor .stripColor (LanguageHelper .getItemDisplayName (stack , "en_us" )).toLowerCase ();
201
201
return "*" .equals (keywords .get (0 )) || keywords .stream ().anyMatch (zhName ::contains ) || keywords .stream ().anyMatch (enName ::contains );
202
202
}
203
203
).forEach (shopItem -> match .put (shop , shopItem ));
0 commit comments