Skip to content

Commit

Permalink
Merge pull request #334 from P3pp3rF1y/1.21.x-dev
Browse files Browse the repository at this point in the history
feat: ✨ Added search in contents of item tooltip using "#" character …
  • Loading branch information
P3pp3rF1y authored Nov 23, 2024
2 parents 9c12ab4 + 06bd49d commit 15c4bc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ loader_version_range=[4,)
mod_id=sophisticatedcore
mod_name=Sophisticated Core
mod_license=GNU General Public License v3.0
mod_version=0.7.11
mod_version=0.7.12
mod_group_id=sophisticatedcore
mod_authors=P3pp3rF1y
mod_description=A library / shared functionality mod for Sophisticated Storage and Backpacks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ private void updateSearchFilter(String searchPhrase) {
if (searchTerm.startsWith("@")) {
String modName = searchTerm.substring(1).toLowerCase();
filters.add(stack -> modName.isEmpty() || BuiltInRegistries.ITEM.getKey(stack.getItem()).getNamespace().contains(modName));
} else if (searchTerm.startsWith("#")) {
String tooltipKeyword = searchTerm.substring(1).toLowerCase();
filters.add(stack -> getTooltipFromItem(minecraft, stack).stream().anyMatch(line -> line.getString().toLowerCase().contains(tooltipKeyword)));
} else {
filters.add(stack -> stack.getHoverName().getString().toLowerCase().contains(searchTerm.toLowerCase()));
}
Expand Down

0 comments on commit 15c4bc4

Please sign in to comment.