mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
Made the booklet search bar search a whole item's tooltip
This commit is contained in:
parent
3d6ecda213
commit
bb0d64e869
1 changed files with 10 additions and 2 deletions
|
@ -229,16 +229,24 @@ public final class BookletUtils{
|
|||
}
|
||||
|
||||
private static boolean getChapterStacksContainString(String text, IBookletChapter chapter){
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
for(BookletPage page : chapter.getPages()){
|
||||
ItemStack[] pageStacks = page.getItemStacksForPage();
|
||||
if(pageStacks != null){
|
||||
for(ItemStack stack : pageStacks){
|
||||
if(stack != null && stack.getDisplayName().toLowerCase(Locale.ROOT).contains(text)){
|
||||
if(stack != null && stack.getItem() != null){
|
||||
List<String> list = stack.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips);
|
||||
for(String s : list){
|
||||
if(s != null && !s.isEmpty()){
|
||||
if(s.toLowerCase(Locale.ROOT).contains(text)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue