AutoModpack Velocity 是 AutoModpack 的 Velocity 配套插件,使您能够在 Velocity 代理网络中使用它。
在安装此插件之前,您应具备关于 AutoModpack 本身的基础知识。
?️ 工作原理
AutoModpack 通常期望 Minecraft 服务器与 AutoModpack 文件托管服务对客户端直接可达。在 Velocity 网络中,客户端首先连接到代理,而实际的模组服务器位于其后方。此插件通过让 Velocity 模拟 AutoModpack 主机并将真实的文件流量转发到正确的后端服务器来填补这一差距。
涉及两个部分:
- 登录阶段通信: AutoModpack 在 Minecraft 的登录插件消息阶段发送其连接详情。Velocity 通常在代理登录完成后不会将那些后端登录插件消息转发给玩家,因此此插件依赖于 LoginPhaseProxy 来代理玩家与所选后端服务器之间的登录阶段通信。
- AutoModpack 流量代理: 当后端服务器发送 AutoModpack 的
automodpack:data 登录消息时,AutoModpack Velocity 会读取后端的 AutoModpack 主机端口,为该后端服务器存储该信息,并重写发送给客户端的消息。它不告诉客户端直接连接到后端,而是告诉客户端连接到 Velocity 代理的 AutoModpack 端点。
此后,客户端下载整合包的方式与独立使用 AutoModpack 完全相同,但其 TCP 连接会通过此插件进行:
- 客户端连接到由代理提供的 AutoModpack 主机。
- 客户端发送 AutoModpack 的特殊主机名握手,使插件知道玩家使用的 Velocity 虚拟主机。
- 插件根据 Velocity 的强制主机和回退服务器顺序解析该主机名,然后选择匹配的后端服务器。
- 使用该后端登录消息中缓存的 AutoModpack 端口,插件向后端服务器的 AutoModpack 主机打开 TCP 连接。
- 从那时起,字节双向转发,因此元数据和整合包文件仍来自后端 AutoModpack 服务器,而客户端只需连接至 Velocity。
默认情况下,port 为 -1,这意味着 AutoModpack 流量与 Velocity 共享相同的公共端口。在此模式下,此插件将早期前端处理程序注入 Velocity 的网络管道:正常的 Minecraft 连接继续通过 Velocity,而 AutoModpack 连接通过其特殊握手被检测并分流到 TCP 代理中。如果您配置了专用的 port,插件将启动自己的 Netty 监听器来处理 AutoModpack 流量。
此插件不生成整合包、不决定哪些文件属于它们,也不添加客户端侧的 AutoModpack 功能。后端服务器仍运行正常的 AutoModpack 模组,并负责生产和托管整合包数据;此插件仅使该工作流程可通过 Velocity 代理使用。
❗️已知限制
切换服务器时不会触发整合包更新
AutoModpack 在 Minecraft 客户端启动以及连接服务器时检查整合包更新。在 Velocity 网络内切换后端服务器时,从客户端的角度来看没有建立新连接,因此不会触发更新检查。
解决方法 1(推荐): 在大厅服务器上安装 AutoModpack,并禁用 modpackHost,将其 addressToSend 和 portToSend 指向后端模组服务器的 AutoModpack 主机。大厅本身无需共享相同的加载器或模组。注意,这里的 addressToSend 指的是后端服务器的本地 IP,而不是 Velocity 主机。
解决方法 2: 使用安装了 AutoModpack 的专用大厅服务器作为入口点,并从所有其他后端服务器中移除 AutoModpack。玩家将在初始连接到大厅时收到整合包更新,之后才会被路由到其他任何服务器。
NeoVelocity 模组无法与 AutoModpack Velocity 配合使用
请尝试改用 Proxy Compatible Forge(兼容 NeoForge)。
⚠️ 安全与信任!
能力越大,责任越大。
我们强烈建议以 Velocity 自身的安全指南 为基础。
由于此插件本身充当代理,您应安全地阻止对后端服务器的直接连接,包括整合包服务器连接端口。您还应了解 AutoModpack 的安全权衡。
? 入门指南
安装 AutoModpack Velocity 就像安装任何其他 Velocity 插件一样简单。
- 配置你的 Velocity(指南)和后端服务器,并安装 AutoModpack(指南)。
- 从 GitHub 或 Modrinth 的发布页面下载 AutoModpack Velocity 插件。
- 从 GitHub 或 Modrinth 的发布页面下载 LoginPhaseProxy 依赖项。
- 将两个下载的文件放入代理服务器的
/plugins/ 文件夹中。
- 重启你的代理服务器。
代理配置
文件位置: /plugins/automodpack/automodpack-proxy.json
这些设置仅适用于 AutoModpack Velocity,不适用于各个后端服务器。有关后端服务器上 AutoModpack 的配置,请参阅 AutoModpack 的文档。
常规设置
| 设置项 |
默认值 |
描述 |
DO_NOT_CHANGE_IT |
<version> |
仅限内部使用。用于在更新期间自动迁移配置版本。请勿手动修改此项。 |
proxyHost |
true |
启用或禁用插件内部的 HTTP 服务器,该服务器代表你的后端服务器将模组包流量代理给客户端。 |
网络与托管
| 设置项 |
默认值 |
描述 |
address |
"" |
与 port 配合使用,当 proxyHost 启用时绑定代理主机,并且始终用于重写发送给客户端的后端 automodpack:data 数据包。留空则绑定到 0.0.0.0 或 ::0。如果 port 为 -1,则忽略绑定。 |
port |
-1 |
与 address 配合使用,当 proxyHost 启用时绑定代理主机,并且始终用于重写发送给客户端的后端 automodpack:data 数据包。-1 表示使用 Velocity 服务器的端口以启用共享端口模式。 |
bandwidthLimit |
0 |
上传速度限制,单位为 Mbps(0 = 无限制)。 |
? 致谢
- Caio Stoduto,他投入了时间和精力来创建此插件!
- Suerion,他协助进行了测试并提供了宝贵的反馈!
- 所有为此插件做出贡献的人,无论是报告问题、建议功能还是贡献代码!
AutoModpack Velocity is a Velocity companion plugin for AutoModpack, enabling you to use it on your Velocity proxy network.
Before installing this plugin, you should have at least basic knowledge of AutoModpack itself.
?️ How does it work
AutoModpack normally expects the Minecraft server and the AutoModpack file host to be directly reachable by the client. In a Velocity network, the client connects to the proxy first, while the actual modded servers live behind it. This plugin bridges that gap by making Velocity look like the AutoModpack host and forwarding the real file traffic to the correct backend server.
There are two parts involved:
- Login-phase communication: AutoModpack sends its connection details during Minecraft's login plugin message phase. Velocity does not normally forward those backend login plugin messages to the player after the proxy login has completed, so this plugin depends on LoginPhaseProxy to proxy that login-phase communication between the player and the selected backend server.
- AutoModpack traffic proxying: When a backend server sends AutoModpack's
automodpack:data login message, AutoModpack Velocity reads the backend's AutoModpack host port, stores it for that backend server, and rewrites the message sent to the client. Instead of telling the client to connect directly to the backend, it tells the client to connect to the Velocity proxy's AutoModpack endpoint.
After that, the client downloads the modpack exactly as it would with standalone AutoModpack, but its TCP connection goes through this plugin:
- The client connects to the proxy-provided AutoModpack host.
- The client sends AutoModpack's magic hostname handshake, which lets the plugin know which Velocity virtual host the player used.
- The plugin resolves that hostname using Velocity's forced-hosts and fallback server order, then picks the matching backend server.
- Using the cached AutoModpack port from that backend's login message, the plugin opens a TCP connection to the backend server's AutoModpack host.
- From that point on, bytes are forwarded both ways, so metadata and modpack files still come from the backend AutoModpack server while the client only needs to reach Velocity.
By default, port is -1, which means AutoModpack traffic shares the same public port as Velocity. In that mode, this plugin injects an early frontend handler into Velocity's network pipeline: normal Minecraft connections continue through Velocity, while AutoModpack connections are detected by their magic handshake and diverted into the TCP proxy. If you configure a dedicated port, the plugin starts its own Netty listener for AutoModpack traffic instead.
This plugin does not generate modpacks, decide which files belong in them, or add client-side AutoModpack features. Backend servers still run the normal AutoModpack mod and remain responsible for producing and hosting the modpack data; this plugin only makes that workflow usable through a Velocity proxy.
❗️Known Limitations
Modpack updates are not triggered on server switches
AutoModpack checks for modpack updates when the Minecraft client launches and when it connects to a server. When switching between backend servers within a Velocity network, no new connection is established from the client's perspective, so no update check is triggered.
Workaround 1 (preferable): Install AutoModpack on the lobby server with modpackHost disabled, and point its addressToSend and portToSend to the backend modded server's AutoModpack host. The lobby itself does not need to share the same mod loader or mods. Note that addressToSend here refers to the backend server's local IP, not the Velocity host.
Workaround 2: Use a dedicated lobby server as the entry point with AutoModpack installed, and remove AutoModpack from all other backend servers. Players will receive modpack updates on initial connection to the lobby, before being routed to any other server.
NeoVelocity mod doesn't work with AutoModpack Velocity
Try using Proxy Compatible Forge instead (compatible with NeoForge).
⚠️ Security and Trust!
With great power comes great responsibility.
We highly recommend following Velocity's own security guide as a basis.
Since this plugin acts as a proxy itself, you should securely block direct connections to your backend servers, including the modpack server connection port. You should also be aware of AutoModpack's security trade-offs.
? Getting Started
Installing AutoModpack Velocity is as simple as installing any other Velocity plugin.
- Setup your Velocity (guide) and backend servers with AutoModpack installed (guide).
- Download the AutoModpack Velocity plugin from the releases page on GitHub, or Modrinth.
- Download the LoginPhaseProxy dependency from the releases page on GitHub, or Modrinth.
- Place both downloaded files into the
/plugins/ folder of your proxy.
- Restart your proxy.
Proxy Configuration
File Location: /plugins/automodpack/automodpack-proxy.json
These settings refers only to the AutoModpack Velocity, not the individual backend servers. For AutoModpack configuration on your backend servers, see AutoModpack's documentation.
General Settings
| Setting |
Default |
Description |
DO_NOT_CHANGE_IT |
<version> |
Internal Use Only. Used to auto-migrate config versions during updates. Do not modify this manually. |
proxyHost |
true |
Enables or disables the plugin internal HTTP server that proxies modpack traffic to clients on behalf of your backend servers. |
Network & Hosting
| Setting |
Default |
Description |
address |
"" |
Used with port to bind the proxy host when proxyHost is enabled, and always used to rewrite the backend automodpack:data packet sent to clients. Empty binds to 0.0.0.0 or ::0. Ignored for binding if port is -1. |
port |
-1 |
Used with address to bind the proxy host when proxyHost is enabled, and always used to rewrite the backend automodpack:data packet sent to clients. -1 uses the Velocity server's port for shared-port mode. |
bandwidthLimit |
0 |
Upload speed limit in Mbps (0 = unlimited). |
? Acknowledgements
- Caio Stoduto, who dedicated his time and effort to creating this plugin!
- Suerion, who helped with testing and provided valuable feedback!
- All contributors who contributed to this plugin, whether by reporting issues, suggesting features, or contributing code!
评论 0
登录后参与评分
还没有评论,来抢沙发吧