Suggestion Tweaker (Fabric/Forge)
这是一个客户端/服务端模组,改进了在输入命令时建议项的过滤和排序方式。
依赖
本模组需要 Cloth Config API。Mod Menu 是可选的,如果你希望拥有更多配置选项(如启用大小写敏感、更改过滤模式等)。
改进的过滤
-
原版通常从建议候选项的开头开始匹配输入内容,如果不匹配则直接丢弃。在某些情况下,它会检查 . 或 _,然后才进行输入内容的匹配。这在搜索时往往因为过于严格而令人恼火。本模组改变了这一行为,现在你可以在不同的过滤模式之间进行选择:
STRICT - 原版的方式
SLIGHTLY LOOSE - 显示包含输入内容任意位置的所建议项
LOOSE - 与上一级类似,但支持多个单词,以 underscore 分隔
VERY LOOSE - 显示包含输入内容中每个字母的建议项
-
具有特定前缀的建议项可以被隐藏。这适用于目录名和文件名。例如,如果特定前缀是下划线,名为 datapack:_function 的标识符将被隐藏,datapack:_directory/function 也会被隐藏,但 datapack:directory/function 不会。此功能适用于所有标识符,而不仅仅是函数。此功能默认禁用。
改进的排序
建议项按照从最严格到最宽松的匹配程度进行排序。原版仅按字母顺序排序,缺乏多种过滤模式。
服务端与客户端
建议项可以分为两组:
- 在服务端进行过滤的(基于客户端输入);
- 例如:函数、战利品表、物品修饰器、谓词以及其他一些
- 在客户端进行过滤的。
由于第一组的过滤由服务端控制,因此建立了一种特殊的变通方法,使客户端能够使用新的建议项过滤方式,而不受服务端影响。因此,本模组也是一个服务端模组,即使对于未安装该模组的客户端也能提供更好的建议项。
示例
顶部为原版,底部为 Suggestion Tweaker。
创意
感谢 SnaveSutit 提供的精彩创意!
Suggestion Tweaker (Fabric/Forge)
This is a client/server mod that improves the way suggestions are filtered and sorted when writing a command.
Dependencies
This mod requires Cloth Config API. Mod Menu is optional in case you want more configuration like enabling case sensitivity and changing the filtering mode.
Improved filtering
-
Vanilla usually starts comparing the input with the start of the suggestion candidate and discards if it doesn't match. In some cases it checks for a . or _ and then the input. This can often be annoying when trying to search for something because it is too strict. This mod changes that, so now you have a choice between different filtering modes:
STRICT - the vanilla way
SLIGHTLY LOOSE - shows all suggestions containing the input anywhere inside
LOOSE - like the previous but with multiple words, separated by an underscore
VERY LOOSE - shows all suggestions containing every letter in the input
-
Suggestions with a specific prefix can be hidden. That applies to both directory and file names. For example, if the specific prefix is an underscore, an identifier named datapack:_function will be hidden and so will be datapack:_directory/function but datapack:directory/function won't be. It works for all identifiers, not just functions. This feature is disabled by default.
Improved sorting
Suggestions are sorted from the strictest to most loose match. Vanilla only sorts alphabetically, lacking multiple filtering modes.
Server and client
Suggestions can be separated into two groups:
- ones that are filtered on the server(based on the client's input);
- e.g. functions, loot tables, item modifiers, predicates, and a few others
- ones that are filtered on the client.
- e.g. scoreboard criteria, colors, blocks, and others
Since the first group's filtering is controlled by the server, a special workaround is established to let the client use the new way of filtering suggestions, independent of the server. Therefore, this mod is also a server mod and provides better suggestions even for clients without the mod.
Examples
Top - vanilla, bottom - Suggestion Tweaker.
Idea
Credit goes to SnaveSutit for the cool idea!
评论 0
登录后参与评分
还没有评论,来抢沙发吧