对 Minecraft 的 SuggestionProvider(建议提供器)进行了微小修改,使其能够为所有模组命名空间下的资源位置自动补全。
虽然这是一个非常小的改动,但如果你经常在使用模组的服务器或客户端中使用命令,它很可能会为你节省大量时间。
注意:此模组无需安装在专用服务器上即可生效,但建议同时安装,以便客户端和服务器的模组列表保持一致。
使用示例
假设你想使用 /give 命令为自己生成来自 Dynamic Trees 模组的 oak_seed(橡树种子)。在原版中,你可能会开始输入 /give @p oak_seed。然而,不会出现自动补全的建议,因为它期望你输入完全限定的名称 dynamictrees:oak_seed:

当安装了 Suggestion Provider Fix 后,开始输入 oak_seed 时,它会建议任何具有该名称的物品,无论它们来自哪个模组。因此,Dynamic Trees 中的橡树种子会被建议出来:

这也适用于其他使用资源位置的注册表,包括方块、生物群系,甚至其他模组的自定义注册表。
许可协议
特此允许在任何整合包或服务器中使用此模组。署名会很棒,但不是必需的。
技术描述
此模组使用 Mixin 来覆盖 SharedSuggestionProvider#filterResources(Iterable, String, Function, Consumer) 方法,执行完全相同的操作,但取消了对 ResourceLocation 的命名空间是否等于 minecraft 的检查(因为当未输入命名空间而仅输入路径时,默认即为 minecraft)。这意味着对于 ResourceLocation 对象,建议提供器在没有输入命名空间的情况下,将建议所有与输入字符串匹配的路径,而不仅仅是来自 Minecraft 本身的那些。
A minor change to Minecraft's suggestion provider so that it auto-completes resource locations for all mod namespaces.
Whilst this is a very tiny change, if you use commands a lot in modded it is likely to save you a lot of time.
Note that this mod does not need to be installed on a dedicated server to work, though doing so is advisable so that the client and server mod list match.
Usage example
Let's say you want to use /give to spawn yourself an oak_seed from Dynamic Trees. With vanilla, you may begin to type /give @p oak_seed. However, no auto-complete suggestions come up, as it expects you to type the fully qualified dynamictrees:oak_seed name:

When Suggestion Provider Fix is installed, beginning to type oak_seed will suggest any items with that name, regardless of which mod adds it. So, the oak seed from Dynamic Trees will be suggested:

This also works with other registries that use resource locations, including blocks, biomes, and even custom registries from other mods.
Licensing
Permission is hereby granted to use this mod in ANY mod pack or server. Attribution would be nice but isn't required.
Technical description
This mod uses a Mixin to overwrite SharedSuggestionProvider#filterResources(Iterable, String, Function, Consumer), doing exactly the same thing but negating a check on whether or not the namespace of the ResourceLocation is equal to minecraft (since this is the default when a path is typed without a namespace). This means that suggestion providers for ResourceLocation objects will suggest all paths matching the input string if no namespace was entered, instead of only those from Minecraft itself.
下载 Suggestion Provider Fix
下载 Suggestion Provider Fix
下载 Suggestion Provider Fix
下载 Suggestion Provider Fix
下载 Suggestion Provider Fix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Suggestion Provider Fix
下载 Suggestion Provider Fix
初始 1.21 版本发布。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧