mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +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,12 +229,20 @@ public final class BookletUtils{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean getChapterStacksContainString(String text, IBookletChapter chapter){
|
private static boolean getChapterStacksContainString(String text, IBookletChapter chapter){
|
||||||
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
for(BookletPage page : chapter.getPages()){
|
for(BookletPage page : chapter.getPages()){
|
||||||
ItemStack[] pageStacks = page.getItemStacksForPage();
|
ItemStack[] pageStacks = page.getItemStacksForPage();
|
||||||
if(pageStacks != null){
|
if(pageStacks != null){
|
||||||
for(ItemStack stack : pageStacks){
|
for(ItemStack stack : pageStacks){
|
||||||
if(stack != null && stack.getDisplayName().toLowerCase(Locale.ROOT).contains(text)){
|
if(stack != null && stack.getItem() != null){
|
||||||
return true;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue