? 关于
Compat API 是一个轻量且通用的兼容性框架,适用于 fixerlink 打造的整个 “Compat” 生态系统——包括 Compat Delight、即将推出的 Compat Artifacts、Compat Decor,以及任何希望以简单、自动的方式添加跨模组集成的第三方模组。
无需硬编码兼容逻辑或手动管理数据包,Compat API 为你处理一切: 自动加载兼容代码、注入数据包、包装战利品修饰符(loot modifiers)、应用条件,并仅在所需模组已安装时启用集成。
? 功能
- 智能 Compat 扫描器:仅从明确依赖 Compat API 的模组中加载集成。
- 自动兼容代码加载:
检测
net.<owner>.<moid>.compats.<target>中的兼容模块,并自动运行其 register、init 或 bootstrap 钩子。 - 自动数据包注入:
将
data/<owner>/<modid>/compats/<target>中的内容作为内置数据包加载——仅当目标模组存在时生效。 - 通用战利品修饰符系统: 自动添加兼容条件并生成全局战利品修饰符列表。
- 兼容性条件:
内置条件
compatapi:compat_enabled确保集成安全加载,且仅在适当情况下启用。 - 按目标配置开关: 每个兼容模块均可通过配置文件单独启用或禁用。
- 安全且整洁的系统: 兼容错误不会导致游戏崩溃——它们会被记录并优雅地跳过。
? 描述
工作原理:
你只需安装 Compat API。 就这样。
如果某个模组依赖 Compat API 并包含兼容模块,该 API 将会:
- 检测其兼容代码
- 注入其兼容数据包
- 包装其战利品修饰符
- 应用条件
- 并自动启用集成
如果目标模组缺失——兼容内容 simply 不会加载。无错误、无崩溃、无需手动设置。模组可以自由添加兼容文件夹和类——所有繁重工作都由 Compat API 完成。当然,每项集成都可通过配置文件进行切换。
? 附加信息
- 不依赖 Compat API 的模组将被完全忽略
- 所有集成仅在对应目标模组存在时加载
- 兼容代码中的错误绝不会破坏游戏
- 全自动系统:代码、数据包、条件、战利品修饰符
- 支持数以千计的集成,仅需极少的样板代码
? 鸣谢
Compat API 由 fixerlink 开发,旨在为所有 Compat 系列模组 以及希望实现干净、模块化且自动化的跨模组集成的开发者提供一个通用标准。
欢迎提供反馈!
? About
Compat API is a lightweight and universal compatibility framework for the entire “Compat” ecosystem by fixerlink — including Compat Delight, the upcoming Compat Artifacts, Compat Decor, and any third-party mod that wants an easy, automated way to add cross-mod integrations.
Instead of hardcoding compat logic or manually managing data packs, Compat API handles everything for you: auto-loading compat code, injecting data packs, wrapping loot modifiers, applying conditions, and enabling integrations only when the required mods are installed.
? Features
- Smart Compat Scanner: Loads integrations only from mods that explicitly depend on Compat API.
- Automatic Compat Code Loading:
Detects compat modules in
net.<owner>.<moid>.compats.<target>and runs their register, init, or bootstrap hooks automatically. - Automatic Data Pack Injection:
Loads content from
data/<owner>/<modid>/compats/<target>as built-in data packs — only when the target mod exists. - Universal Loot Modifier System: Adds compat conditions automatically and generates the global loot modifier list.
- Compatibility Conditions:
Built-in condition
compatapi:compat_enabledensures integrations load safely and only when appropriate. - Per-Target Config Toggles: Every compat module can be enabled or disabled individually via config.
- Safe & Clean System: Compat errors never crash the game — they’re logged and gracefully skipped.
? Description
How it works:
You install Compat API. That’s it.
If a mod depends on Compat API and includes compat modules, the API will:
- detect its compat code
- inject its compat data packs
- wrap its loot modifiers
- apply conditions
- and enable integrations automatically
If the target mod is missing — the compat simply won’t load. No errors, no crashes, no manual setup needed. Mods can freely add compat folders and classes — Compat API does all the heavy lifting. And of course, every integration can be toggled via config.
? Bonus Info
- Mods that do not depend on Compat API are fully ignored
- All integrations load only when their target mods are present
- Errors in compat code never break the game
- Fully automated system: code, data packs, conditions, loot modifiers
- Supports thousands of integrations with minimal boilerplate
? Credits
Compat API is developed by fixerlink as a universal standard for all Compat-series mods and for developers who want clean, modular, and automated cross-mod integrations.
Feedback is welcome!
下载 Compat API
下载 Compat API
下载 Compat API
下载 Compat API
下载 Compat API
下载 Compat API
下载 Compat API
下载 Compat API
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
评论 0
登录后参与评分
还没有评论,来抢沙发吧