-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create JEI-like Advanced Search #485
Conversation
Just to make sure, the "Search Widget Scope" is a new settings category that does not exist as-is in Is there anything in this PR I could assist with in the next few days? Any open sub-issues? |
yes, scope added in this PR |
NotEnoughCharacters just register a SearchField.ISearchProvider to support jei search style and extra search support. |
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 |
yes,and chinese support also dependends on ISearchProvider |
If I understand the |
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. |
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? |
YES, it helps nech not to affect non-Chinese users. |
@vfyjxf, for example
|
|
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 |
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 |
Prefix Schema:Item Subset (
|
fix modname. please use |
I used naming from JEI/REI |
NEI Search Style (old style). Item Name/Tooltip/Mod Name include: JEI/REI Search Style (new style). Item Name include: run p.s. sorry for my english ) |
|
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 |
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. |
yes it was a bug |
you need registry API.addSearchProvider like in this example or not suitable? |
but this reject my provider i think |
you provider should be added after the default. this condition searches for the first from the end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be working as intended.
And I havn't run into any issues during my testing.
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