Applied KJS (AE2 × KubeJS 桥接)
一个强大的 AE2 ↔ KubeJS 桥接模组,为整合包开发者提供可脚本化的 AE2 配方、网络监控、存储/合成事件、设备检查以及可选的 ME 合成工作自动化功能。
Applied KJS 是 Applied Energistics 2 (AE2) 和 KubeJS 之间的桥接模组,让整合包开发者能够深入且以脚本方式访问 AE2 系统,而无需为每个整合包编写专用的 Java 附加模组。
如果你想在 KubeJS 中构建以 AE2 为核心的进度系统、自动化、诊断、警报或配方重制,这个模组正是为此工作流程设计的。
Wiki 页面 可以在 这里 找到!(即将推出,你可以查看我的拉取请求 here。你还可以查看 Wiki 页面的原始代码 here。)
此模组新增内容
✅ AE2 配方脚本辅助工具(适用于 KubeJS)
从脚本中创建和管理 AE2 配方的 JSON,包括针对常见 AE2 配方类型的辅助功能,例如:
- 充电器配方
- 刻印机配方(包括压模设置)
- 转换配方
- 熵配方(加热/冷却行为)
- 物质炮弹药行为条目
还包含有助于以下操作的实用工具:
- 安全地构建配方 JSON
- 验证并将配方 JSON 转换为字符串
- 从 KubeJS 中添加/移除 AE2 配方
- 通过输出、类型或 JSON 匹配模式移除配方(适用于大型整合包重制)
✅ 暴露给 JS 的 AE2 键封装(物品/流体)
在 KubeJS 友好的对象中使用 AE2 风格的物品/流体键。
这使得更容易:
- 解析 AE2 物品/流体标识符
- 比较键(精确/模糊匹配)
- 读取 ID/模组 ID/显示名称
- 格式化数量以类似于 AE2 的方式
- 将键数据序列化为 JSON,用于日志、UI 或调试
非常适合需要以清晰方式理解 AE2 存储/合成数据的脚本。
✅ ME 网络(网格)监控 API
从脚本中检查和跟踪 AE2 网络。
该桥接可以暴露网格摘要和网络状态,以便你围绕以下内容构建自定义逻辑:
- 网络在线/离线状态
- 电力存储和使用
- 控制器/通道状态
- 节点数量
- CPU 数量
- 请求/合成数量
- 存储摘要信息
这特别有用,可用于:
- 进度系统
- 自定义任务
- 服务器诊断
- 自动化触发器
- 管理员工具和警报
✅ AE2 活动的 KubeJS 事件(服务端)
直接在脚本中响应 AE2 事件。
事件类别示例包括:
网络生命周期 / 状态
存储跟踪
- 存储增量变化(物品/流体数量变化)
- 阈值穿越事件(自定义监视触发)
合成生命周期
- 合成请求
- 合成工作开始/完成/停止
- 卡住的合成检测事件
玩家交互 / 进度钩子
- 终端打开事件
- 玩家里程碑事件(用于教程/任务进度)
这能够实现高度动态的整合包逻辑,例如:
- 当 ME 系统失去电力时警告玩家
- 当库存达到阈值时触发任务
- 当 CPU 卡住时记录或通知管理员
- 当玩家首次与 AE2 终端交互时解锁指南章节
✅ 存储阈值监视
注册针对特定 AE2 物品/流体的监视(可选地限定于特定网格),并在存储量超过阈值时做出反应。
非常适合:
- 低库存警报
- 自动化进度检查
- 软自动化触发
- 整合包健康监控 / 仪表盘
✅ 可选的脚本化 AE2 合成请求 API(高级)
通过脚本计划和可选地提交 AE2 合成工作。
这可用于:
- 模拟/计划 ME 合成请求
- 检查所需的字节和工作详情
- 查看计划中的缺失/已用/发出的物品
- 提交工作(在提供有效的请求者上下文时)
- 跟踪/取消已提交的工作
这是希望拥有脚本控制的 AE2 自动化逻辑的高级整合包的强大功能。
重要提示: 出于安全和控制考虑,合成请求 API 在服务端配置中默认处于禁用状态。整合包开发者必须手动启用它。
✅ AE2 设备检查辅助工具
检查指定位置的 AE2 相关方块实体/设备,并读取对脚本或管理员工具有用的状态信息。
根据设备不同,这可能包括如下信息:
- 类/类型名称
- 位置/维度
- 激活/通电状态
- 驱动器/箱子存储摘要信息
- 附加的网格摘要
可用于:
✅ 进度里程碑钩子(感知 AE2)
该桥接包含用于玩家进度和教程流程的里程碑式钩子。
这使得构建整合包入门逻辑变得容易,例如:
- 首次登录里程碑
- 首次 AE2 合成里程碑
- 控制器制造里程碑
- 合成终端 / 分子组装台里程碑
- 其他 AE2 进度检查点
理想情况下适用于:
- FTB Quests / 自定义任务书
- 游戏内教程系统
- 基于解锁的进度整合包
✅ 调试命令和数据转储
包含可选的管理员/调试命令支持(服务端,受权限限制),用于收集统计信息、网格摘要和诊断转储。
非常适合:
- 整合包开发
- 多人游戏故障排除
- 在脚本化设置中对 AE2 行为进行分析
为什么整合包开发者可能需要这个模组
Applied KJS 帮助你构建通常需要编写自定义 Java 集成模组才能实现的系统,例如:
- 支持 AE2 的进度脚本编写
- 动态配方平衡调整
- 库存监控与警报
- 脚本化自动化控制
- 自定义诊断仪表盘
- 管理员辅助工具
- 与 ME 活动绑定的事件驱动游戏玩法
如果你已经在重度使用 KubeJS,这将为你提供一种更深层次的方式将 AE2 集成到你的整合包逻辑中。
示例用例
- 任务门控: 检测玩家首次打开终端时,解锁教程章节。
- 自动化安全: 当 ME 网络失去动力或合成 CPU 卡住时,向管理员发出警报。
- 资源管理: 当 Certus Quartz(认证石英)库存低于阈值时触发事件。
- 配方重做整合包: 完全通过 KubeJS 替换或调整 AE2 机器配方。
- 进度整合包: 在关键 AE2 组件被合成时授予里程碑奖励。
配置(服务端)
该桥接模组旨在可根据整合包/服务器的需求进行配置。
典型选项包括对以下方面的开关和限制:
- 网络事件
- 存储事件
- 合成事件
- 终端事件
- 进度钩子
- 调试命令
- 合成请求 API
- 扫描间隔 / 追踪限制
- 事件防刷屏保护 / 节流机制
- 日志详细程度
- 维度过滤器 / 白名单
建议:从默认设置开始,仅在脚本需要时才启用高级功能(特别是合成请求 API)。
要求 / 兼容性
- Minecraft: 1.20.1(此处显示的是 Forge 构建版)
- 依赖: Applied Energistics 2 (AE2)
- 依赖: KubeJS
- 加载器: Forge(本项目页面/构建目标)
请始终查看 Files 标签页和更新日志,以获取适合你整合包的正确模组版本和依赖版本。
给脚本作者的说明
本模组主要面向 服务端整合包逻辑 和 整合包开发者脚本工作流。
一般而言:
- 使用 启动脚本 来注册可复用的辅助函数/常量(如需要)
- 使用 服务器脚本 处理 AE2 事件、监控、阈值和自动化逻辑
- 仅在你使用的构建/版本提供了特定的客户端交互功能时,才使用 客户端脚本
权限与整合包使用
你可以将本模组包含在整合包中,但须遵守项目的许可证/许可条款。
有关确切的使用权利,请参阅项目的仓库/许可证页面。
问题报告 / 反馈
报告问题时,请提供以下信息:
- Minecraft 版本
- 加载器/版本(Forge)
- AE2 版本
- KubeJS 版本
- Applied KJS 版本
- 日志文件及复现步骤
- 相关的 KubeJS 脚本(如有)
这将大大加快集成问题的调试速度。
TL;DR
Applied KJS 将 AE2 转变为可供 KubeJS 驱动的整合包进行脚本控制的系统 —— 让你能够构建配方、响应 ME 事件、监控网格、检查设备,并以少得多的自定义 Java 工作量(可选地)自动化 AE2 合成流程。
Applied KJS (AE2 × KubeJS Bridge)
A powerful AE2 ↔ KubeJS bridge for modpack developers that adds scriptable AE2 recipes, network monitoring, storage/crafting events, device inspection, and optional ME crafting job automation.
Applied KJS is a bridge mod for Applied Energistics 2 (AE2) and KubeJS that gives modpack developers deep, scriptable access to AE2 systems without writing a dedicated Java addon for every pack.
If you want to build AE2-focused progression, automation, diagnostics, alerts, or recipe overhauls in KubeJS, this mod is built for that workflow.
The wiki page can be found here! (coming soon, you can view my pull request here. And you can view the wiki page's raw code here.)
What this mod adds
✅ AE2 recipe scripting helpers for KubeJS
Create and manage AE2 recipe JSON from scripts, including helpers for common AE2 recipe types such as:
- Charger recipes
- Inscriber recipes (including press-style setups)
- Transform recipes
- Entropy recipes (heat/cool behavior)
- Matter Cannon ammo behavior entries
Also includes utilities to help with:
- Building recipe JSON safely
- Validating and stringifying recipe JSON
- Adding/removing AE2 recipes from KubeJS
- Removing recipes by output, type, or JSON match patterns (useful for large pack overhauls)
✅ AE2 key wrappers (items/fluids) exposed to JS
Work with AE2-style item/fluid keys in KubeJS-friendly objects.
This makes it easier to:
- Parse AE2 item/fluid identifiers
- Compare keys (exact/fuzzy matching)
- Read IDs/mod IDs/display names
- Format amounts similarly to AE2
- Serialize key data to JSON for logs, UIs, or debugging
Perfect for scripts that need to understand AE2 storage/crafting data in a clean way.
✅ ME network (grid) monitoring APIs
Inspect and track AE2 networks from scripts.
The bridge can expose grid summaries and network state so you can build custom logic around:
- Network online/offline state
- Power storage and usage
- Controller/channel state
- Node counts
- CPU counts
- Request/crafting counts
- Storage summary information
This is especially useful for:
- Progression systems
- Custom quests
- Server diagnostics
- Automation triggers
- Admin tools and alerts
✅ KubeJS events for AE2 activity (server-side)
React to AE2 events directly in your scripts.
Examples of event categories include:
Network lifecycle / status
- Network created / removed
- Network changed
- Network power state changes
Storage tracking
- Storage delta changes (item/fluid amount changes)
- Threshold crossing events (custom watch triggers)
Crafting lifecycle
- Crafting requested
- Crafting job started/completed/stopped
- Stuck crafting detection events
Player interaction / progression hooks
- Terminal opened events
- Player milestone events (for tutorials/quest progression)
This enables highly dynamic pack logic such as:
- Warning players when the ME system loses power
- Triggering quests when stock reaches a threshold
- Logging or notifying admins when a CPU gets stuck
- Unlocking guide chapters when players first interact with AE2 terminals
✅ Storage threshold watches
Register watches for specific AE2 items/fluids (optionally scoped to a specific grid) and react when stored amounts cross a threshold.
Great for:
- Low-stock alerts
- Automated progression checks
- Soft automation triggers
- Pack health monitoring / dashboards
✅ Optional scripted AE2 crafting request API (advanced)
Plan and optionally submit AE2 crafting jobs through scripts.
This can be used to:
- Simulate/plan an ME craft request
- Inspect required bytes and job details
- View missing/used/emitted items from a plan
- Submit a job (when valid requester context is provided)
- Track/cancel submitted jobs
This is a powerful feature for advanced packs that want script-controlled AE2 automation logic.
Important: The crafting request API is disabled by default in the server config for safety/control. Pack devs must enable it manually.
✅ AE2 device inspection helpers
Inspect AE2-related block entities/devices at positions and read useful state for scripts or admin tools.
Depending on the device, this may include information like:
- Class/type name
- Position/dimension
- Active / powered state
- Drive/chest storage summary info
- Attached grid summary
Useful for:
- Debug commands
- Admin scripts
- Quest validation
- In-game diagnostic tools
✅ Progression milestone hooks (AE2-aware)
The bridge includes milestone-style hooks for player progression and tutorial flows.
This makes it easy to build pack onboarding logic like:
- First login milestone
- First AE2 craft milestone
- Controller crafted milestone
- Crafting terminal / molecular assembler milestones
- Other AE2 progression checkpoints
Ideal for:
- FTB Quests / custom questbooks
- In-game tutorial systems
- Unlock-based progression packs
✅ Debug commands and data dumps
Includes optional admin/debug command support (server-side, permission-gated) for collecting stats, grid summaries, and diagnostic dumps.
Excellent for:
- Pack development
- Multiplayer troubleshooting
- Profiling AE2 behavior in scripted setups
Why modpack developers might want this
Applied KJS helps you build systems that would normally require writing a custom Java integration mod, such as:
- AE2-aware progression scripting
- Dynamic recipe rebalancing
- Stock monitoring and alerts
- Scripted automation control
- Custom diagnostics dashboards
- Admin support tooling
- Event-driven gameplay tied to ME activity
If you already use KubeJS heavily, this gives you a much deeper way to integrate AE2 into your pack logic.
Example use cases
- Quest gating: Detect when a player first opens a terminal and unlock a tutorial chapter.
- Automation safety: Alert admins when an ME network loses power or a crafting CPU gets stuck.
- Resource management: Fire events when Certus Quartz stock drops below a threshold.
- Recipe overhaul packs: Replace/adjust AE2 machine recipes entirely from KubeJS.
- Progression packs: Grant milestones when key AE2 components are crafted.
Configuration (server-side)
The bridge is designed to be configurable for pack/server needs.
Typical options include toggles and limits for areas such as:
- Network events
- Storage events
- Crafting events
- Terminal events
- Progression hooks
- Debug commands
- Craft request API
- Scan intervals / tracking limits
- Event spam protection / throttles
- Logging verbosity
- Dimension filters / allowlists
Recommended: Start with default settings, then enable advanced features (especially crafting request APIs) only when your scripts need them.
Requirements / Compatibility
- Minecraft: 1.20.1 (Forge build shown here)
- Requires: Applied Energistics 2 (AE2)
- Requires: KubeJS
- Loader: Forge (this project page/build target)
Always check the Files tab and changelog for the correct mod versions and dependency versions for your pack.
Notes for script authors
This mod is primarily aimed at server-side pack logic and modpack developer scripting workflows.
In general:
- Use startup scripts to register reusable helpers/constants (if desired)
- Use server scripts for AE2 events, monitoring, thresholds, and automation logic
- Use client scripts only if a specific client-facing integration is provided by the build/version you are using
Permissions & Modpack Use
You may include this mod in modpacks subject to the project’s license/permission terms.
Please refer to the project’s repository/license page for exact usage rights.
Issue Reporting / Feedback
When reporting issues, please include:
- Minecraft version
- Loader/version (Forge)
- AE2 version
- KubeJS version
- Applied KJS version
- Logs and reproduction steps
- Relevant KubeJS scripts (if applicable)
This makes debugging integration issues much faster.
TL;DR
Applied KJS turns AE2 into a scriptable system for KubeJS-powered modpacks — letting you build recipes, react to ME events, monitor grids, inspect devices, and (optionally) automate AE2 crafting flows with far less custom Java work.
评论 0
登录后参与评分
还没有评论,来抢沙发吧