This commit is contained in:
SeanOMik 2022-01-27 17:40:37 -05:00
parent 226d28cd3b
commit 340c8caaea
2 changed files with 8 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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)) {