Go Minecraft Bridge
Go Minecraft Bridge 将使用 Go 编写的插件同时托管在 Minecraft 服务器和客户端进程中。面向 Minecraft 的代码保留在 Java 中,而插件逻辑则接收不可变的快照/事件,并返回动作或命名系统调用。
共享代码构建为两个特定版本的 Fabric 制品:
| Minecraft |
Java |
Loader |
Fabric API |
Cloth Config |
Mod Menu |
1.21.1 |
21 |
0.16.14 |
0.116.14+1.21.1 |
15.0.140 |
11.0.3 |
26.1.2 |
25 |
0.19.3 |
0.149.1+26.1.2 |
26.1.154 |
18.0.0 |
Architectury Loom 驱动可移植的 1.21.1 目标,针对 Minecraft API 差异提供了少量源代码覆盖层。未混淆的 26.1.2 目标使用 Fabric Loom,因为 Architectury Loom 目前需要依赖一个该 Minecraft 发行版未发布的映射制品(mappings artifact)。Architectury 的可移植性仍会为每个 Minecraft ABI 生成一个 JAR;它并不会生成一个通用的 JAR。
当前的 MVP 还针对以下内容进行了支持:
- Go 1.24 或更高版本;
- 使用
-buildmode=c-shared 构建的原生 Go 插件;
- 初始化、服务器/客户端刻(tick)、聊天、死亡、系统调用结果以及反初始化的回调;
- 实体快照以及对方块位置的显式订阅;
- 聊天广播/直接消息动作;
- 可扩展的命名空间系统调用;
- 捕获 Go 的
stdout、stderr 以及标准 log 包输出;
- FlatBuffers 刻快照(ABI v2),而控制平面消息仍保持 JSON 格式;
- 通过 Mod Menu 暴露的 Cloth Config 管理界面。
后端接口故意独立于 Fabric 和原生 FFI,以便未来可以使用 WASI/WASM 后端实现相同的协议。
服务器运行时也打包为一个 Paper 插件,兼容 Paper 和 Purpur。其 Bukkit 面向代码在每次构建时均针对以下 API 矩阵进行编译:
| Server |
Paper API used for verification |
Java runtime |
Paper/Purpur 1.21.1 |
1.21.1-R0.1-SNAPSHOT |
21+ |
Paper/Purpur 1.21.11 |
1.21.11-R0.1-SNAPSHOT |
21+ |
Paper/Purpur 26.1 |
26.1.2.build.74-stable |
25+ |
Paper API 保留了桥接所使用的 Bukkit 表面,因此这些目标共享同一个 Java 21 字节码 JAR。Purpur 直接接受它,因为 Purpur 是一个与 Paper 兼容的服务器实现。
使用方法
请访问 source github 查看
路线图
- 添加屏幕渲染实现
- 更多系统调用和可用性改进
- 带有注册机制的事件系统
- 客户端的单文件 JAR
- 可能还有更多...
代码采用 MIT 许可证授权。
Go Minecraft Bridge
Go Minecraft Bridge hosts plugins written in Go in both Minecraft server and
client processes. The Minecraft-facing code stays in Java, while plugin logic
receives immutable snapshots/events and returns actions or named system calls.
The shared code is built as two version-specific Fabric artifacts:
| Minecraft |
Java |
Loader |
Fabric API |
Cloth Config |
Mod Menu |
1.21.1 |
21 |
0.16.14 |
0.116.14+1.21.1 |
15.0.140 |
11.0.3 |
26.1.2 |
25 |
0.19.3 |
0.149.1+26.1.2 |
26.1.154 |
18.0.0 |
Architectury Loom drives the portable 1.21.1 target, with a small source
overlay for Minecraft API differences. The unobfuscated 26.1.2 target uses
Fabric Loom because Architectury Loom currently requires a mappings artifact
that this Minecraft distribution does not publish. Architectury portability
still produces one JAR per Minecraft ABI; it does not make one universal JAR.
The current MVP also targets:
- Go 1.24 or newer;
- native Go plugins built with
-buildmode=c-shared;
- initialization, server/client tick, chat, death, system-call-result, and deinitialization callbacks;
- entity snapshots and explicit subscriptions to block positions;
- chat broadcast/direct-message actions;
- extensible namespaced system calls;
- capture of Go
stdout, stderr, and the standard log package;
- FlatBuffers tick snapshots (ABI v2), while control-plane messages remain JSON;
- a Cloth Config management screen exposed through Mod Menu.
The backend interface is deliberately independent from Fabric and native FFI so
that a WASI/WASM backend can implement the same protocol later.
The server runtime is also packaged as one Paper plugin compatible with Paper
and Purpur. Its Bukkit-facing code is compiled during every build against this
API matrix:
| Server |
Paper API used for verification |
Java runtime |
Paper/Purpur 1.21.1 |
1.21.1-R0.1-SNAPSHOT |
21+ |
Paper/Purpur 1.21.11 |
1.21.11-R0.1-SNAPSHOT |
21+ |
Paper/Purpur 26.1 |
26.1.2.build.74-stable |
25+ |
The Paper API preserves the Bukkit surface used by the bridge, so these targets
share one Java 21 bytecode JAR. Purpur accepts it directly because Purpur is a
Paper-compatible server implementation.
Using
Visit source github to check
Roadmap
- Adding screen render implementation
- More systemcalls and usability
- Event system with registration
- All-in-one JAR file for client
- Maybe some more...
Code is licenced under MIT Licence.
评论 0
登录后参与评分
还没有评论,来抢沙发吧