
本模组为 Sodium/Embeddium 选项菜单集成提供了跨平台事件。例如,你可以通过单一事件为 Forge 上的 Embeddium、1.20.1 的 Fabric Sodium 0.5 以及 1.21.1 的 Fabric/NeoForge Sodium 0.6 添加选项页:
OptionGUIConstruction.EVENT.register((pages) -> pages.add(new TestOptionPage()));
如果你是最终用户,且尚未将此模组作为其他 Sodium 插件的库安装,你可以将其与 Reese's Options 一起安装,以获得改进的分类菜单,并支持下拉支持以便更轻松地导航。即使对于不直接使用此 API 而是直接注入 Sodium 选项的模组,这也同样生效。

本模组部分基于 Embeddium 分类 API 和选项事件的分叉版本,并进行了大量修改以支持上游 Sodium。虽然它会对 Reese's Sodium Options 菜单进行修改,但出于兼容性考虑,这些修改是通过 mixin 实现的,因此你需要同时安装两者。
使用 API
首先,你需要通过 Maven 发布版本将本模组添加到你的开发环境中,可以使用 Curseforge 或 Modrinth 的发布源。
modImplementation("maven.modrinth:sodium-options-api:version")
然后,本模组在 toni.sodiumoptionsapi.api 中提供了三个事件:
OptionGUIConstruction.EVENT,在 GUI 构造函数中调用一次,允许添加整个页面。这可能是你最需要的一个。OptionPageConstruction.EVENT,为每个 OptionPage 调用。如果你想在性能标签页中添加一组切换项或其他内容,请使用此方法。OptionGroupConstruction.EVENT,为每组选项调用。如果你想在现有组中插入单个选项,或修改原版选项,请使用此方法。

This mod adds cross-platform events for adding Sodium/Embeddium options menu integration. For example, you can add an option page to Embeddium on Forge, Fabric Sodium 0.5 on 1.20.1, and Fabric/NeoForge Sodium 0.6 on 1.21.1 with one event:
OptionGUIConstruction.EVENT.register((pages) -> pages.add(new TestOptionPage()));
If you're an end user, and you don't have this mod installed already as a library for another Sodium addon, you can install it alongside Reese's Options to get improved category menu, with drop-down support so that it's easier to navigate. This will take effect even for mods that don't use this API and inject into Sodium options directly.

This mod is partially a fork of the Embeddium categories API and options events, with heavy changes to support upstream Sodium. While it makes changes to the Reese's Sodium Options menu, it does so via mixin for compatibility reasons, so you will need to install both.
Using the API
First, you will need to add this mod to your dev environment, using the Maven release for Curseforge or Modrinth.
modImplementation("maven.modrinth:sodium-options-api:version")
Then, this mod provides three events in toni.sodiumoptionsapi.api:
OptionGUIConstruction.EVENT, called once in the GUI constructor, allows adding entire pages. This is probably the one you want.OptionPageConstruction.EVENT, called for each OptionPage. Use this if you want to add a group of toggles to the performance tab or something.OptionGroupConstruction.EVENT, called for each group of options. Use this if you want to insert a single option into an existing group, or modify the vanilla ones.
下载 Sodium Options API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Sodium Options API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Sodium Options API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Sodium Options API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Sodium Options API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Sodium Options API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Sodium Options API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Sodium Options API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Sodium Options API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Sodium Options API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
移植至 1.21.5
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
原版世界生成优化模组
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
评论 0
登录后参与评分
还没有评论,来抢沙发吧