Closed slprime closed 3 weeks ago
move Focus Search Widget on Open
config option to Search Widget scope, and rename
move
Focus Search Widget on Open
config option to Search Widget scope, and rename
Just to make sure, the "Search Widget Scope" is a new settings category that does not exist as-is in master
right now, correct?
Is there anything in this PR I could assist with in the next few days? Any open sub-issues?
Just to make sure, the "Search Widget Scope" is a new settings category that does not exist as-is in
master
right now, correct?
yes, scope added in this PR
- WE NEED someone who understands how
NotEnoughCharacters
works and whether the behavior is preserved. and how much this mod is needed by a new search. I don't know Chinese and can't check.
NotEnoughCharacters just register a SearchField.ISearchProvider to support jei search style and extra search support. But I may need to change some of the code to be compatible with both the new nei and the old nei.
And are you using the same tree search as jei? If you ported it, then nech may need additional changes to be more compatible with nei.
And are you using the same tree search as jei? If you ported it, then nech may need additional changes to be more compatible with nei.
No, I don't use the JEI tree. I've changed the search field parser. In the current version, prefixes only worked at the beginning of the search text. Now, it's split into tokens, and an ItemFilter is generated based on them. The only change I made was to deprecate ISearchProvider and add ISearchParserProvider, so that other mods wouldn't break with the new search.
In NotEnoughCharacters
exists @
, $
, &
prefixes which are already added the new search
In NotEnoughCharacters exists @, $, & prefixes which are already added the new search
yes,and chinese support also dependends on ISearchProvider
In NotEnoughCharacters exists @, $, & prefixes which are already added the new search
yes,and chinese support also dependends on ISearchProvider
If I understand the net.minecraft.nechar.NecharSearchFilter
class correctly, it is not needed in the new search.
If I understand the net.minecraft.nechar.Nechar SearchFilter class correctly, it is not needed in the new search.
No, matchesKeywords method provide support of chinese pinyin search
@slprime also,can you provide an api that allows a certain item filter to be enabled only if the game is in a certain language, like the input method api for rei.
@slprime also,can you provide an api that allows a certain item filter to be enabled only if the game is in a certain language, like the input method api for rei.
yes, I'll add it after work
@vfyjxf, you need api which apply custom ISearchParserProvider only if the game is in a certain language, else use default ISearchParserProvider? correct?
@vfyjxf, you need api which apply custom ISearchParserProvider only if the game is in a certain language, else use default ISearchParserProvider? correct?
YES, it helps nech not to affect non-Chinese users.
@vfyjxf, for example
@Override
public List<Language> getMatchingLanguages() {
return ISearchParserProvider.getAllLanguages().stream()
.filter(lang -> lang.getLanguageCode().startsWith("zh_"))
.collect(Collectors.toCollection(ArrayList::new));
}
API.addSearchProvider(
new SearchParserProvider(
'\0',
"default",
EnumChatFormatting.RESET,
(pattern) -> new PatternItemFilter(pattern)) {
@Override
public SearchMode getSearchMode() {
return SearchMode.ALWAYS;
}
@Override
public List<Language> getMatchingLanguages() {
return ISearchParserProvider.getAllLanguages().stream()
.filter(lang -> lang.getLanguageCode().startsWith("zh_"))
.collect(Collectors.toCollection(ArrayList::new));
}
});
API.addSearchProvider(
new SearchParserProvider(
'#',
"tooltip",
EnumChatFormatting.YELLOW,
(pattern) -> new TooltipFilter(pattern)) {
@Override
public List<Language> getMatchingLanguages() {
return ISearchParserProvider.getAllLanguages().stream()
.filter(lang -> lang.getLanguageCode().startsWith("zh_"))
.collect(Collectors.toCollection(ArrayList::new));
}
});
Just to be clear: do I understand correctly that this changes the connection between terms from OR to AND? Then one gets OR instead with |
?
I am not even saying I hate that, but that was one of the reasons NECh was rejected.
there seems to be another issue, in that it no longer searches the internal item names which results in very different results. This is certainly going to be controversial.
here is a before/after:
Edit: I have been told that this is what you meant by id in your description. Which is well definetely not correctly named then, But adding &
does indeed work.
here is another issue from testing: I cant search for blood magic items (assuming I am a player who doesnt know the secret password is @awwayof
). something like #"blood magic"
does not work. I guess the tooltip search is somewhat broken or am I doing something wrong?
%
). In previous version you use @
to search by this list. Now @
usage for modname (jei style)%
, not @
. Or you can disable the prefix for %
and use @
as before. It’s unlikely that you used the like @block
search often.|
cannot be disabled. here is another issue from testing: I cant search for blood magic items (assuming I am a player who doesnt know the secret password is
@awwayof
). something like#"blood magic"
does not work. I guess the tooltip search is somewhat broken or am I doing something wrong?
fix modname. please use @"blood magic"
Edit: I have been told that this is what you meant by id in your description. Which is well definetely not correctly named then, But adding
&
does indeed work.
I used naming from JEI/REI
Just to be clear: do I understand correctly that this changes the connection between terms from OR to AND? Then one gets OR instead with
|
?I am not even saying I hate that, but that was one of the reasons NECh was rejected.
NEI Search Style (old style). |
implement NECh
Item Name/Tooltip/Mod Name include:
rune<space>
of<space>
super<space>
|<space>
green<space>
backpack
JEI/REI Search Style (new style). |
split search to 2 search rules. like OreDict Card
Item Name include: run<or>
of<or>
super
or Item Name include: green <or>
backpack
p.s. sorry for my english )
- How much of a change is this from the default search?
- Is this behind a config, or on by default?
Fantastic change. The new versions of Jei have done the same thing, and it's much more convenient than what Nei has now. Looking forward to seeing this added to the game.
leaving two search options is a bad idea. the code will become much more complex. the new search can work like the old search if you change some settings (in the comment above), not 100% but very close. if you search by name/tooltip/mod name/id or use @
to search for a mod, that will enough
How search works (3:50-9:30) https://youtu.be/c77g2imldpk?si=m37tmz3pN_CUAF_n&t=229
@slprime I would like to ask if this situation is a bug? IConfigureNEI.loadConfig is later than SearchTokenParser.getProviders, usually mod authors choose to register ISearchParserProvider via NEIConfig, but SearchTokenParser has kept a cache before that, which causes ISearchParserProvider registered by other mods to be unavailable unless the player switches languages and clears the cache.
And how do I override the original ISearchParserProvider, obviously nech needs to override the prefix-less and tooltip ISearchParserProvider to support its additional search functionality, mixin is probably not a good idea.
And how do I override the original ISearchParserProvider, obviously nech needs to override the prefix-less and tooltip ISearchParserProvider to support its additional search functionality, mixin is probably not a good idea.
yes it was a bug
SearchParserProvider
And how do I override the original ISearchParserProvider, obviously nech needs to override the prefix-less and tooltip ISearchParserProvider to support its additional search functionality, mixin is probably not a good idea.
you need registry API.addSearchProvider like in this example or not suitable? https://github.com/GTNewHorizons/NotEnoughItems/pull/485#issuecomment-2164458039
SearchParserProvider
And how do I override the original ISearchParserProvider, obviously nech needs to override the prefix-less and tooltip ISearchParserProvider to support its additional search functionality, mixin is probably not a good idea.
you need registry API.addSearchProvider like in this example or not suitable? #485 (comment)
but this reject my provider i think
SearchParserProvider
And how do I override the original ISearchParserProvider, obviously nech needs to override the prefix-less and tooltip ISearchParserProvider to support its additional search functionality, mixin is probably not a good idea.
you need registry API.addSearchProvider like in this example or not suitable? #485 (comment)
but this reject my provider i think
you provider should be added after the default. this condition searches for the first from the end
Advanced search:
@
- search by mod (@minecraft
)#
- search by tooltip (#UV-Tier
)&
- search by id: (&95:15
extratrees:door
)$
- search by ore dictionary ($ore
)%
- search by subsets (%block
)|
- logical or. multi-item search (wrench|hammer
)-
- logical not. exclude items that match the following expression (-@minecraft
)"
- multiple words wrapped in quotes are treated as one condition rather than several ("White Stained Glass"
)Search Mode (apply on search parts, not full string):
Plain
- simple stringExtended
- allow only?
,*
rulesRegex
- allow full regexIn Extended Search Mode:
?
- any character (@min?craft
)*
- any few characters (@m*ft
=@minecraft
)r/.../
- standard java regex (@r/m\w{6}ft/
=@minecraft
)More colors:
Settings:
P.S.
NotEnoughCharacters
works and whether the behavior is preserved. and how much this mod is needed by a new search. I don't know Chinese and can't check.P.S.2