Fix #31
This commit is contained in:
parent
226d28cd3b
commit
340c8caaea
|
@ -321,8 +321,13 @@ public class ESTerminalGUI implements InventoryHolder, Listener {
|
|||
int amount = entry.getValue();
|
||||
|
||||
text = text.toLowerCase();
|
||||
|
||||
List<String> lore = itemMeta.getLore();
|
||||
if (Utils.listStringContainsString(lore, text) || itemMeta.getDisplayName().toLowerCase().contains(text) || item.getType().toString().toLowerCase().contains(text) || item.getType().toString().toLowerCase().replace("_", " ").contains(text)) {
|
||||
if (Utils.listStringContainsString(lore, text) ||
|
||||
itemMeta.getLocalizedName().toLowerCase().contains(text) ||
|
||||
itemMeta.getDisplayName().toLowerCase().contains(text) ||
|
||||
item.getType().name().toLowerCase().contains(text) ||
|
||||
item.getType().name().toLowerCase().replace("_", " ").contains(text)) {
|
||||
search.put(item, amount);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,6 +121,8 @@ public class Utils {
|
|||
}
|
||||
|
||||
public static boolean listStringContainsString(List<String> list, String string) {
|
||||
if (list == null || list.isEmpty()) return false;
|
||||
|
||||
string = string.toLowerCase();
|
||||
for (String str : list) {
|
||||
if (str.toLowerCase().contains(string)) {
|
||||
|
|
Loading…
Reference in New Issue