ThatOrThis
一款用于在 Fabric 模组组之间进行选择的 Fabric 模组。
这是什么
ThatOrThis 主要面向整合包开发者设计。它通过 Hack 方式介入 Fabric 加载器,允许从额外的、由用户选择的可目录中加载模组。这使得最终用户可以决定将哪些模组加载到他们的整合包中,或者解决不兼容的模组集问题。
从技术层面来说,ThatOrThis 的设计灵感来源于 Modsmod 和 GrossFabricHacks,它们利用了 Fabric 加载器的 LanguageAdapter 功能。这允许该模组的部分代码在 Fabric 加载器开始初始化大多数其他模组之前 运行。随后它会读取配置文件,解析出需要额外加载的模组,并通过 Java 反射技巧将它们注入到加载器中。
特性
- 从默认
.minecraft/mods 之外的目录加载模组
- 让最终用户选择他们想要的功能(例如 OptiFabric 用于光影或 Sodium 用于优化)
- 对额外模组的依赖关系和冲突进行运行时检查
- 可通过 ModMenu 集成访问的可配置设置界面
- 选项名称和工具提示支持格式化代码和翻译键
使用方法
对于普通用户(手动安装此模组的用户)
将此模组与 ModMenu 和 Fabric API 一起安装到你的 mods 文件夹中。
启动 Minecraft 并通过 ModMenu 打开设置界面。按照说明操作。
如果这样配置,ThatOrThis 将在默认的(受限的)规则集下运行。如果你需要的功能不仅仅是切换单个模组,请参阅“整合包开发者”部分。
对于整合包用户(下载了包含此模组的整合包的用户)
通过 ModMenu 打开设置界面。根据需要更改设置。完成。
请注意,新设置直到你重新 launching 游戏才会生效。
对于整合包开发者(希望将此模组集成到整合包中的用户)
将此模组与 ModMenu 和 Fabric API 一起安装到你的 mods 文件夹中。
然后,在你的 config 文件夹中创建 thatorthis 文件夹,并在其中创建文件 rules.json。如果操作正确,其路径应为 .minecraft/config/thatorthis/rules.json。
rules.json 定义了所有可用的设置及其选项。关于它的规范可以在 这里 找到。
最后,根据规则文件中定义的内容,将模组放入 mods 文件夹的子目录中。
此模组开源并采用 MIT 许可证,这意味着你可以将其包含在你的整合包中并进行再分发,无需征得许可,只要你在你的整合包中注明我的名字(当然还有所有其他模组的作者)。
兼容性
- ThatOrThis 需要 较新版本的 Minecraft
和 Fabric Loader 才能工作。
- Forge 支持从未计划;请改用 ModDirector。
- 目前仅支持 Fabric Loader v0.11.x。对 v0.12.x 的支持将在 ThatOrThis v0.3.0 中提供。
- ModMenu 和 Fabric API 是 可选的,这意味着在拥有有效的
rules.json 和 choices.json 的情况下,即使没有它们,ThatOrThis 也能正常工作。
- 然而,它们对于游戏内设置界面是必需的。你可以通过 ThatOrThis 加载它们,但不推荐这样做。
- 不建议通过 ThatOrThis 加载编程语言支持模组(例如 Kotlin、Scala 和 Grovvy)。
- 它们可能可以工作,但该功能尚未经过测试;如有可能,请将它们直接放入 mods 目录中。
- Modsmod 对 Fabric 加载器执行的操作与 ThatOrThis 完全相同,因此两者 不兼容。
注意:ThatOrThis 仅 适用于小型、客户端模组。如果规则和选项设计不当,可能会导致崩溃以及服务器/世界不兼容的问题。在安装此模组前后,请彻底测试你的整合包。
ThatOrThis
A Fabric mod for choosing between sets of Fabric mods.
What is this
ThatOrThis is designed mainly for modpack developers. It hacks into Fabric Loader to allow loading mods from additional user-selectable directories. This allows the end user to choose which mod(s) to load into their modpack, or workaround incompatible mod sets.
Technically speaking, ThatOrThis take its inspiration from Modsmod and GrossFabricHacks, which abuses the LanguageAdapter feature of the Fabric Loader. This allows part of this mod's code to run even before Fabric Loader starts to initialize most other mods. It then read configs, resolve for additional mods to load, and inject them into the loader via Java reflection wizardry.
Features
- Load mods from directories other than the default
.minecraft/mods
- Let the end user to choose which feature(s) they want (e.g. OptiFabric for shaders or Sodium for optimization)
- Runtime check for dependencies and conflicts of additional mods
- Configurable settings screen accessible via ModMenu integration
- Option names and tooltips support formatting codes and translation keys
Usage
For ordinary users (who installed this mod manually)
Install this mod into your mods folder, along with ModMenu and Fabric API.
Launch Minecraft and open the settings screen via ModMenu. Follow the instructions.
ThatOrThis will be running under the default (limited) rule set if configured this way. If you need features more than toggling individual mods, please refer to the "modpack developers" section.
For modpack users (who downloaded a modpack containing this mod)
Open the settings screen via ModMenu. Change the settings as you desire. Done.
Note that the new settings won't come into effect until you re-launch the game.
For modpack developers (who wish to integrate this mod into a modpack)
Install this mod into your mods folder, along with ModMenu and Fabric API.
Then, create thatorthis folder in your config folder, and file rules.json in that. If done correctly, the path for it should be .minecraft/config/thatorthis/rules.json.
rules.json defines all the available settings and their options. Specs for it can be found here.
Finally, put the mods into subdirectories of the mods folder, as defined in the rule file.
This mod is open-sourced and MIT licensed, meaning that you can include it into your modpack and redistribute it without asking for permission, as long as you credit me (and of course the authors of all other mods) in your modpack.
Compatibility
- ThatOrThis requires a recent version of Minecraft
and Fabric Loader to work.
- Forge support is never planned; use ModDirector instead.
- Currently only Fabric Loader v0.11.x is supported. Support for v0.12.x will come with ThatOrThis v0.3.0.
- ModMenu and Fabric API are optional, meaning that ThatOrThis will work correctly without them given valid
rules.json and choices.json.
- However they are required for the in-game settings screen. You can load them via ThatOrThis, but it is not recommended.
- Loading programming language support mods (e.g. for Kotlin, Scala and Grovvy) via ThatOrThis is not recommended.
- They might work, but this feature has not been tested; place them right into the mods directory whenever possible.
- Modsmod does the exact same thing as ThatOrThis to the Fabric Loader, thus incompatible with each other.
NOTE: ThatOrThis is only intended for small, client-side mods. It may cause crashes and/or server/world incompatibilities if rules and options are not designed carefully. Test your modpack throughly before and after installing this mod.
评论 0
登录后参与评分
还没有评论,来抢沙发吧