搜索历史
清空
暂无搜索历史
论坛热搜
1
【MC整合包发布】乌托邦探险之旅3.2
热
3
[1.6.4]上古老物 冒险者传说 by WhiteSword
新
5
[转载]洛心斗罗-福利|公会据点战|武魂||抽奖|最终版
2
[1.12.2]Jenny — 有趣的模拟女友模组|珍妮模组
热
4
幻虚斗罗V1.5[炫酷魂环][高级魂技][全模型贴图覆盖][超吸金]
6
[1.7.10] [HQM] [Mercury landing]水星迫降——在未知的世界中挣扎
登陆 注册 QQ登陆
快捷导航
查看: 10|回复: 0

[模组分享] 建议 API (Suggestions API)-MOD模组

[复制链接]

5017

主题

60

回帖

1万

积分

龙❁妻

Rank: 8Rank: 8

经验
10298 EP
金粒
5181 粒
绿宝石
20 块
爱心
0 点
发表于 2025-8-10 19:30:33 | 显示全部楼层 |阅读模式
建议 API (Suggestions API)Github |相关wiki |源站链接支持: fabric , forge , neoforge , quilt建议 API 是用于处理 Minecraft 建议的库。它允许您添加建议并可以更改它们的渲染方式。使用此库,您可以静态或动态地添加建议。

哪些模组使用建议 API?

以下模组使用建议 API:

-
- https://modrinth.com/mod/jime]JIME

入门指南

将以下内容合并到您的代码中。下面是适用于 Fabric 或 Quit 的示例。如果您正在开发 Forge 或 Neoforge,请将 `fabric` 替换为 `forge`(从建议 API v1.0.4 开始适用此方式)。

build.gradle
groovyrepositories {maven {url = \"https://api.modrinth.com/maven\"}}
dependencies {modImplementation \"maven.modrinth:suggestions-api:1.0.6+fabric\"}

build.gradle.kts
groovyrepositories {maven(\"https://api.modrinth.com/maven\")}
dependencies {modImplementation(\"maven.modrinth\", \"suggestions-api\", \"1.0.6+fabric\")}

快速文档

快速文档包含了该库的基本信息。

嵌入式建议有哪些类型?

`Suggestion` 接口位于 `io.github.aratakileo.suggestionsapi.suggestion`。

该库有两种内置类型的建议。以下是它们初始化的函数:

- Suggestion.simple(...) - 简单的(仅文本)
- Suggestion.withIcon(...) - 带图标的(将在左侧渲染)

... (以下省略)

截图:

https://i.sodamc.com/modrinth/0t6KoxhFlc.jpg?x-oss-process=style/forge2]

来自Modrinth所有游戏版本1.201.20.11.20.21.20.31.20.4所有类型forgeneoforgefabricquiltSuggestions API 1.0.6+1.20-1.20.4-forgesuggestions-api-1.0.6+1.20-1.20.4-forge.jar下载1.0.6+forge#Releasesuggestions-api-1.0.6+1.20-1.20.4-forge-sources.jar下载1.0.6+forge#ReleaseCritical bug fix展开版本: 1.0.6+forge支持游戏: 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4类型:ForgeNeoForgeRelease下载次数: 278Suggestions API 1.0.6+1.20-1.20.4-fabricsuggestions-api-1.0.6+1.20-1.20.4-fabric.jar下载1.0.6+fabric#Releasesuggestions-api-1.0.6+1.20-1.20.4-fabric-sources.jar下载1.0.6+fabric#ReleaseCritical bug fix展开版本: 1.0.6+fabric支持游戏: 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4类型:FabricQuiltRelease下载次数: 687Suggestions API 1.0.5+1.20-1.20.4-forgesuggestions-api-1.0.5+1.20-1.20.4-forge.jar下载1.0.5+forge#Releasesuggestions-api-1.0.5+1.20-1.20.4-forge-sources.jar下载1.0.5+forge#Release## What\'s Changed* Fix freeze when typing certain commands [#37](https://github.com/aratakileo/emogg/issues/37) [#3](https://github.com/aratakileo/suggestions-api/pull/3)[[Full Changelog v1.0.4...v1.0.5]](https://github.com/aratakileo/suggestions-api/compare/v1.0.4...v1.0.5)展开版本: 1.0.5+forge支持游戏: 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4类型:ForgeNeoForgeRelease下载次数: 86Suggestions API 1.0.5+1.20-1.20.4-fabricsuggestions-api-1.0.5+1.20-1.20.4-fabric.jar下载1.0.5+fabric#Releasesuggestions-api-1.0.5+1.20-1.20.4-fabric-sources.jar下载1.0.5+fabric#Release## What\'s Changed* Fix freeze when typing certain commands [#37](https://github.com/aratakileo/emogg/issues/37) [#3](https://github.com/aratakileo/suggestions-api/pull/3)[[Full Changelog v1.0.4...v1.0.5]](https://github.com/aratakileo/suggestions-api/compare/v1.0.4...v1.0.5)展开版本: 1.0.5+fabric支持游戏: 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4类型:FabricQuiltRelease下载次数: 100Suggestions API 1.0.4+1.20-1.20.4-forgesuggestions-api-1.0.4+1.20-1.20.4-forge.jar下载1.0.4+forge#Releasesuggestions-api-1.0.4+1.20-1.20.4-forge-sources.jar下载1.0.4+forge#Release- port to `Forge` and `Neoforge`展开版本: 1.0.4+forge支持游戏: 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4类型:ForgeNeoForgeRelease下载次数: 123Suggestions API 1.0.4+1.20-1.20.4suggestions-api-1.0.4+1.20-1.20.4.jar下载1.0.4+fabric#Releasesuggestions-api-1.0.4+1.20-1.20.4-sources.jar下载1.0.4+fabric#Release- extended documentation- fixed a Minecraft bug related to duplicate invocation of injectors- now, inside the injectors associated with entering text into the input field in the method responsible for generating new suggestions, a `StringContainer` is passed as an argument, which contains more detailed information about the current context (full text from the input field, cursor position, whether a command is being entered, etc.)- now, by default, you can add suggestions regardless of the context (whether the player is currently entering a command or not)- implicit replacement of other suggestions is now prohibited. Instead, it is allowed to replace suggestions added outside of the Suggestions API using `ReplacementInjector`- the core has been rebuilt**Full Changelog**: https://github.com/aratakileo/suggestions-api/compare/v1.0.3...v1.0.4展开版本: 1.0.4+fabric支持游戏: 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4类型:FabricQuiltRelease下载次数: 179Suggestions API 1.0.3+1.20-1.20.4suggestions-api-1.0.3+1.20-1.20.4.jar下载1.0.3#Releasesuggestions-api-1.0.3+1.20.x-sources.jar下载1.0.3#Release- new parameter `IconSuggestion#isIconOnLeft`- new Injector `InjectorListener` that let listen events: onSessionInited (by `InjectorListener#onSessionInited(...)`), onSuggestionSelected (by `InjectorListener#onSuggestionSelected(...)`)- move `SuggestionsAPI#registerSuggestionsInjector(...)` to `SuggestionsAPI#registerInjector(...)`- move `SuggestionsAPI#addResourceDependedSuggestionsContainer(...)` to `SuggestionsAPI#addResourceDependedContainer(...)`- code structure has been refactored**Full Changelog**: https://github.com/aratakileo/suggestions-api/compare/v1.0.2...v1.0.3展开版本: 1.0.3支持游戏: 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4类型:FabricQuiltRelease下载次数: 165Suggestions API 1.0.2+1.20-1.20.1suggestions-api-1.0.2+1.20.x.jar下载1.0.2#Releasesuggestions-api-1.0.2+1.20.x-sources.jar下载1.0.2#Release- multiplayer crash fix [#1](https://github.com/aratakileo/suggestions-api/pull/1)- refactored from `SuggestionsAPI#registerResourceDependedInjector` to `SuggestionsAPI#addResourceDependedSuggestionsContainer`- now, by default, the mechanism for ignoring nested suggestions is enabled for each injector- other small changes展开版本: 1.0.2支持游戏: 1.20, 1.20.1类型:FabricQuiltRelease下载次数: 102Suggestions API 1.0.1+1.20-1.20.1suggestions-api-1.0.1+1.20.x.jar下载1.0.1#Releasesuggestions-api-1.0.1+1.20.x-sources.jar下载1.0.1#ReleaseRedesigned interface for asynchronous injector. All the logic of asynchrony has been moved from it to another place展开版本: 1.0.1支持游戏: 1.20, 1.20.1类型:FabricQuiltRelease下载次数: 142Suggestions API 1.0.0+1.20-1.20.1suggestions-api-1.0.0+1.20.x.jar下载1.0.0#Releasesuggestions-api-1.0.0+1.20.x-sources.jar下载1.0.0#ReleaseFirst release展开版本: 1.0.0支持游戏: 1.20, 1.20.1类型:FabricQuiltRelease下载次数: 132全部版本

markdown_parsed

文章类型:收录

layui.use([\'form\'], function(){
var form = layui.form;
});

游客,如果您要查看本帖隐藏内容请回复
建议 API
楼主 2025-8-10 19:30:33 回复 收起回复
小僵尸论坛感谢有你~
回复 论坛版权

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 手机动态码快速登录

本版积分规则



介绍

我的世界(Minecraft)小僵尸论坛
收录了来自各地的我的世界(MC)爱好者们的各种资源

须知: 切勿滥用举报,任何与举报相关的信息必须属实!

"Minecraft"以及"我的世界"为Mojang Synergies AB的商标 本站与Mojang以及微软公司没有从属关系

官方

新浪微博 腾讯微博 微信公众号 投稿规则 版权声明 捐助我们

官方QQ①群: 291907844 (点击加群)
官方QQ②群: 421312192
官方QQ③群: 528726532

我的世界(Minecraft)小僵尸论坛

新会员

QQ|Archiver|手机版|小黑屋|Minecraft(我的世界)小僵尸论坛 |网站地图

GMT+8, 2025-9-25 10:38 , Processed in 0.240354 second(s), 53 queries .

快速回复 返回顶部 返回列表