From 064e9b12d5b4446d782dc3d8b71294b646905a28 Mon Sep 17 00:00:00 2001 From: MachieCodes Date: Mon, 6 Jan 2025 11:33:58 -0600 Subject: [PATCH] Hide Modules in Search Gorp --- .../meteorclient/systems/modules/Modules.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java index 37ec252a92..7f4ab2678f 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java @@ -172,6 +172,8 @@ public Set searchTitles(String text) { Map modules = new ValueComparableMap<>(Comparator.naturalOrder()); for (Module module : this.moduleInstances.values()) { + if (Config.get().hiddenModules.get().contains(module)) continue; + int score = Utils.searchLevenshteinDefault(module.title, text, false); if (Config.get().moduleAliases.get()) { for (String alias : module.aliases) { @@ -179,6 +181,7 @@ public Set searchTitles(String text) { if (aliasScore < score) score = aliasScore; } } + modules.put(module, modules.getOrDefault(module, 0) + score); } @@ -189,6 +192,8 @@ public Set searchSettingTitles(String text) { Map modules = new ValueComparableMap<>(Comparator.naturalOrder()); for (Module module : this.moduleInstances.values()) { + if (Config.get().hiddenModules.get().contains(module)) continue; + int lowest = Integer.MAX_VALUE; for (SettingGroup sg : module.settings) { for (Setting setting : sg) { @@ -196,6 +201,7 @@ public Set searchSettingTitles(String text) { if (score < lowest) lowest = score; } } + modules.put(module, modules.getOrDefault(module, 0) + lowest); }