? ZstdNet — Minecraft 联机的透明 ZSTD 压缩
一句话总结: ZstdNet 运行一个透明代理,实时使用 ZSTD 压缩客户端与服务器之间的流量。在高重复数据量的服务器上,它将公网带宽消耗降至原始流量的约 1/20,而玩家几乎毫无感知。
(中文说明见下方 「中文介绍」。)
⚡ TL;DR
?️ 将多人联机带宽压缩至原来的 ~5–20%,减少 80%+ 的公网流量消耗。 开启自动接管后,玩家只需输入相同的 IP 和端口——无需学习新操作。未安装任何模组原版玩家也能正常连接,不受影响。
? 谁受益最大
| 场景 |
优势原因 |
| ⚙️ Create 模组服务器 |
大量重复的动力学数据——极高的压缩比 |
| ? 大型整合包服务器 |
登录时的注册表/标签/配方爆发数据可被训练字典进一步压缩 |
| ? FRP / NAT 穿透 / 隧道托管 |
直接节省公网流量,避开隧道速率限制 |
| ? 单人房主开启局域网 |
为朋友提供更省带宽的连接入口 |
? 效果究竟有多显著
以下是来自大型整合包服务器 齿轮盛宴 ("Gear Feast") 的真实服务端样本。在同一时间段内,原始流量已达 189 GB,而压缩后实际传输仅 10 GB:
Raw: 189.06 GB (3.6MB/s) | Zstd: 10.28 GB (252.7KB/s) | Ratio: 5.44% | Conns: 8
Raw: 189.06 GB (5.0MB/s) | Zstd: 10.28 GB (234.3KB/s) | Ratio: 5.44% | Conns: 8
Raw: 189.07 GB (4.8MB/s) | Zstd: 10.28 GB (303.7KB/s) | Ratio: 5.44% | Conns: 8
? Ratio = 5.44% 意味着仅有约 1/20 的原始流量真正穿越了公网。随之降低的还有带宽费用、FRP 流量消耗以及隧道速率限制。
✨ 核心功能
- ? 自动接管,零学习成本 — 默认
auto_takeover=true 时,模组会接管原始公网端口,并将后端 MC 服务器静默移至本地端口;玩家继续使用相同地址连接。
- ?️ 覆盖客户端 / 专用服务器 / 单人开局域网 — 专用服务器、插件版本以及单人世界“对局域网开放”的主机均可使用。
- ? 内置实时 HUD — 在游戏中一目了然地查看 ZSTD 是否激活,以及实时速率、累计流量、压缩比和连接数。
- ? 原生状态 Ping 透传 — 服务器列表 Ping 正常显示,并展示玩家数量 / MOTD。
- ? 同端口 UDP 透传 — 兼容依赖 Minecraft 同端口 UDP 的模组,如 Sable / Create: Aeronautics。
- ?️ 零配置语音模组兼容 — 自动检测后端 Simple Voice Chat / Plasmo Voice 的专用 UDP 端口并将其接管;玩家加入时自动打开监听器,主机无需填写任何内容(适用于模组服务器和插件)。在默认的
tunnel 模式下,语音复用单一入口端口,因此 FRP / NAT 穿透只需转发一个端口。
- ? AutoModpack 兼容 — AutoModpack 5.x 整合包同步功能对通过 ZstdNet 加入的玩家有效;仅需服务器端安装 ZstdNet 1.4.2-m2.10 或更高版本。
- ?️ 可选防洪水攻击保护 — 在单 IP 限制之上:提供全局连接上限、全局连接/登录速率限制(含登录锁定)、快速断开封禁及递增式封禁。默认全部关闭;请在
zstdnet-server.properties 中启用。
? 亮点功能:区块引用缓存 (CRC,默认开启)
对于反复发送相同区块的服务器(进出区块循环、跨维度往返、重连后重载——这在 Create 和大整合包中非常常见),ZSTD 的滑动窗口只能折叠“近期”的重复数据。ZstdNet 在此基础上增加了一个区块引用缓存 (Chunk Reference Cache):
- 会话内 REF — 当本次会话中再次发送相同区块时,仅发送 8 字节的引用令牌;客户端重放本地缓存的字节数据。
- 跨会话 WARM_REF — 完整发送过的区块会被持久化到磁盘;重连后仍保留在内存中的区块将以 16 字节令牌形式发送,跨越游戏会话节省流量。
- 字节级 PATCH — 当区块仅有微小变化时,发送相对于基线的差异增量,而非整个区块数据。
CRC 和 ZSTD 是乘法关系,而非二选一:CRC 消除的是重复块(chunks)的数量,ZSTD 压缩的是剩余部分的字节。该功能默认开启(chunk_cache=auto),但仅在连接协商支持后才对字节进行处理——不支持或未升级的客户端将按字节透传,任何运行时异常均会失败关闭(重新连接,绝不会发送错误数据包)。
? 高级压缩(全部可选,默认关闭)
- ? 长距离匹配 (LDM) —— 适用于“大型相同结构在几分钟内反复出现”的服务端,进一步压缩体积比。
- ? 一键自动字典 —— 在服务端设置
dictionary_auto=true:它会自动采样实时流量 → 后台训练 → 热启用并将字典推送给玩家,无需重启,无需手动分发。在登录注册表/标签/配方爆发以及大量小包洪水场景下收益最大。
- ? 实体数据包流变换 —— 适用于高实体负载场景(如 Create 机械装置、刷怪笼、突袭),在压缩前可逆地解交错实体移动/元数据,从而提升这些场景的压缩率。
✅ 这些功能默认关闭且为可选。默认配置与历史行为逐字节完全一致,并保持与未升级客户端的协议兼容——如果任一方未启用,该连接将静默回退到纯透传模式。
? 内置高级版(Mojang)验证 —— 无需额外模组
ZstdNet 可以在登录过程中自行验证正版账户(访问令牌永不离开客户端),因此即使后端处于离线模式,你也能保留真正的正版 UUID/皮肤,同时保持压缩功能开启——无需再安装 TrueUUID。配置项 premium_verification 默认为 auto(跟随 server.properties 中的 online-mode)。适用于 Fabric / Forge / NeoForge 1.18.2 ~ 26.3 版本,以及 Velocity 插件。(Bukkit/Spigot 插件构建版不支持此功能——请在此处保持后端 online-mode=false。)
? 支持的版本与平台
建议在客户端和服务端都进行安装。
| 加载器 |
版本 |
| ? Forge |
1.16.5 / 1.18.2 / 1.19.2 / 1.20.1 |
| ? NeoForge |
1.20.1 / 1.21.1 / 1.21.11 / 26.1 / 26.2 / 26.3 |
| ? Fabric |
1.19.3 / 1.20.1 / 1.20.4 / 1.21.1 / 1.21.11 / 26.1 / 26.2 / 26.3 |
| ? 插件 / 混合 |
Bukkit / Spigot / Paper / Purpur,以及 Arclight / Mohist / CatServer(单个 jar 覆盖 1.20.1 和最新的 1.21.x) |
| ? Velocity 代理 |
Velocity 3.4 / 3.5 / 4.x(单个 jar;后端服务器无需安装任何东西) |
(26.1 / 26.2 / 26.3 构建版各自覆盖其完整的 26.x 系列,需要 Java 25。1.21.11 构建版仅覆盖 1.21.11。Fabric 1.20.4 构建版也覆盖 1.20.3。1.16.5 和 1.18.2 仅限 Forge。)
? 插件构建版(无模组加载器): 将 zstdnet-bukkit jar 放入 plugins/ 目录。压缩需要两端配合——想要压缩的玩家仍需安装 ZstdNet 客户端模组;未安装它的原版玩家正常连接且不受影响。
? Velocity 构建版(网络): 将 zstdnet-velocity jar 放入 Velocity 的 plugins/ 目录,并打开它创建的 zstd 入口端口(默认为 Velocity 端口 + 1)。真实 IP 和正版验证会自动处理。
⚙️ 必要设置(专用服务端)
在使用专用服务端的内置 ZstdNet 服务端入口之前,请在后端 server.properties 中至少设置以下内容:
online-mode=false
希望在中继离线模式时保留正版身份?请使用上述内置正版验证(模组构建版),或在插件构建版中搭配 TrueUUID 使用。
? 常用命令
| 命令 |
功能 |
/zstdhud |
查看 / 切换游戏内 HUD(on / off / toggle) |
/zstdport |
查看或更改端口,适用于单人/LAN 托管(show / game / zstd / voice / zstdvoice) |
运行时配置位于 Minecraft 的 config/ 目录中:客户端 zstdnet-client.toml,服务端 zstdnet-server.properties(自动维护,支持热重载)。
? 本构建版相比原版新增内容
本构建版由 xuenai · 麦块联机 (MineKuai) 基于原始 wish131400/zstdnet (MIT) 进行的深度分叉。原版已具备 ZSTD 代理、自动接管、同端口 UDP 透传、HUD 和多加载器支持等功能,但仅覆盖 1.20.1 / 1.21.1。在此基础上,本构建版增加了:
- ? 更广泛的版本与平台支持 —— 新增 Forge 1.16.5 / 1.18.2 / 1.19.2,Fabric 1.19.3 / 1.20.4,1.21.11 以及 Minecraft 26.1 / 26.2 / 26.3,以及插件/混合构建版(Bukkit / Spigot / Paper / Purpur, Arclight / Mohist),单个 jar 覆盖 1.20.1 和 1.21.x,具备 Folia 支持,以及用于网络的 Velocity 代理插件。
- ?️ 更强的压缩能力 —— 长距离匹配,以及具备零配置自动分发功能的训练字典(
dictionary_auto=true)。
- ? 块引用缓存(默认开启)和 ? 实体数据包流变换(可选)—— 两者均经过协商,协议兼容且失败关闭。
- ?️ 零配置语音模组兼容性 —— 自动检测后端 Simple Voice Chat / Plasmo Voice 的 UDP 端口(
tunnel / bridge 传输方式)。
- ? 内置正版验证 —— 在离线后端上使用正版 UUID,无需额外模组。
- ? 自动整合包兼容性 以及可选的 ?️ 防洪水保护(默认关闭)。
CRC 默认开启;LDM / 字典 / 实体变换默认关闭且为可选,所有功能均与未升级客户端协议兼容。
? 致谢与许可
基于 wish 的 wish131400/zstdnet (MIT) 构建——上游版权声明和许可声明保留在每个 jar 包内部。由 xuenai · 麦块联机 / MineKuai (minekuai.com) 维护并扩展。
源代码:github.com/xuenaimiao/zstdnet-minekuai。本构建整体采用 CC BY-NC-SA 4.0 协议(非商用、相同方式共享、保留署名);wish 的原始部分仍为 MIT。
随每个 jar 打包的第三方组件完整声明(LICENSE / NOTICE):zstd-jni(BSD 2-Clause,内含 Meta 的 Zstandard,BSD 2-Clause)。「区块引用缓存」的 full / ref / patch 思路借鉴参考 BandwidthOptimizer(LGPL 2.1),但 ZstdNet 的实现是净室自研,未使用其任何代码。
?? 中文介绍
一句话:将客户端与服务端之间的转发流量实时通过 ZSTD 进行压缩,公网带宽直接降至原来的 二十分之一 左右,而玩家几乎完全无感。
ZstdNet 利用 ZSTD 算法实时压缩客户端与服务端之间的转发流量。在「数据高度重复」的联机场景下大幅削减公网带宽占用。开启自动接管后,玩家只需填写原来那个 IP 和端口即可;未安装模组的原版玩家也能照常进服,互不影响。
? 它尤其适合谁
| 场景 |
为什么受益 |
| ⚙️ Create 类服务器 |
大量重复的机械运转数据,压缩率极高 |
| ? 大型整合包服务器 |
登录初始的 registry / tag / recipe 爆发可被字典进一步压扁 |
| ? FRP / 内网穿透 / 隧道转发 |
直接省下公网流量与穿透限速 |
| ? 单机开房的房主 |
想给朋友一个更省带宽的入口 |
? 实际效果有多夸张
大型整合包「齿轮盛宴」服务器侧的一组真实统计 —— 同一段时间内原始流量已经跑到 189 GB,压缩后实际只传输了 10 GB:
Raw: 189.06 GB (3.6MB/s) | Zstd: 10.28 GB (252.7KB/s) | Ratio: 5.44% | Conns: 8
Raw: 189.06 GB (5.0MB/s) | Zstd: 10.28 GB (234.3KB/s) | Ratio: 5.44% | Conns: 8
Raw: 189.07 GB (4.8MB/s) | Zstd: 10.28 GB (303.7KB/s) | Ratio: 5.44% | Conns: 8
? Ratio = 5.44%,意味着公网上实际只跑了原始流量的 二十分之一 左右。
✨ 核心特性
- ? 自动接管,玩家零学习成本 —— 默认
auto_takeover=true,模组接管原公网端口、把后端 MC 悄悄挪到本地端口,玩家继续连原地址即可。
- ?️ 客户端 / 服务端 / 单机开房全覆盖 —— 专用服、插件端、以及单机「对局域网开放」的房主都能用。
- ? 内置实时 HUD —— 游戏里一眼看清当前是否在走 ZSTD、实时速率、累计流量、压缩率、连接数。
- ? 原版状态查询透传 —— 服务器列表能正常 ping、显示在线人数和 MOTD。
- ? 同端口 UDP 原样透传 —— 兼容 Sable / Create: Aeronautics 等依赖同端口 UDP 的模组。
- ?️ 语音模组零配置兼容 —— 自动探测后端 Simple Voice Chat / Plasmo Voice 的独立 UDP 端口并一起接管,玩家进服自动开监听,服主无需手填端口。默认
tunnel 模式下语音也复用入口端口这一个口。
- ? 兼容 AutoModpack —— 经 ZstdNet 进服的玩家可以正常用 AutoModpack 5.x 同步整合包,只需服务端升级到 1.4.2-m2.10 及以上。
- ?️ 可选的防刷保护 —— 在单 IP 限制之上,新增全服连接数上限、全服连接 / 登录限速与登录 lockdown、秒退封禁、封禁次数升级。全部默认关闭,按需在
zstdnet-server.properties 里开启。
? 区块引用缓存(CRC,默认开启)
针对「同一个区块被反复下发」的场景(反复进出区块、跨维度往返、重连后重新加载 —— Create 系与大型整合包尤为常见),在 ZSTD 之前把客户端已持有的相同区块换成 8/16 字节令牌(会话内 REF / 跨会话 WARM_REF)或字节级增量(PATCH),与 ZSTD 叠加进一步压低带宽。默认 chunk_cache=auto、协商生效、fail-closed 不损坏数据 —— 不支持的客户端逐字节透传。
? 进阶压缩能力(全部可选,默认关闭)
- ? 长距离匹配(LDM) —— 面向「同样的大结构几分钟内反复出现」的服务器,进一步榨干压缩率。
- ? 一键全自动字典 —— 服务端设
dictionary_auto=true 即可:自动采样 → 后台训练 → 热插启用并下发玩家,无需重启、无需手动分发。
- ? 实体包流变换 —— 面向大量实体 / 生物场景(Create 契约体、刷怪塔、怪潮),在压缩前做可逆去交错。
✅ 以上选项默认关闭、可选开启;默认配置与历史行为逐字节一致,并对未升级客户端保持线兼容 —— 一端没开就自动回退原样转发。
? 内置正版验证(无需额外装 mod)
ZstdNet 可在登录阶段内置正版账号验证(access token 不出客户端),在离线后端上也能保留真实正版 UUID/皮肤,压缩照常 —— 无需再装 TrueUUID。premium_verification 默认 auto(跟随 server.properties 的 online-mode)。Fabric / Forge / NeoForge(1.18.2 ~ 26.3)与 Velocity 插件全已内置;Bukkit/Spigot 插件端暂不支持,请保持后端 online-mode=false。
? 支持的版本与平台
推荐客户端和服务端都安装。
| 加载器 |
支持版本 |
| ? Forge |
1.16.5 / 1.18.2 / 1.19.2 / 1.20.1 |
| ? NeoForge |
1.20.1 / 1.21.1 / 1.21.11 / 26.1 / 26.2 / 26.3 |
| ? Fabric |
1.19.3 / 1.20.1 / 1.20.4 / 1.21.1 / 1.21.11 / 26.1 / 26.2 / 26.3 |
| ? 插件端 / 混合端 |
Bukkit / Spigot / Paper / Purpur,以及 Arclight / Mohist / CatServer(一个 jar 跨 1.20.1 与 1.21.x) |
| ? Velocity 代理端 |
Velocity 3.4 / 3.5 / 4.x(一个 jar;子服什么都不用装) |
(26.1 / 26.2 / 26.3 构建各自覆盖整条 26.x 线,需要 Java 25。1.21.11 构建只覆盖 1.21.11 本身。Fabric 1.20.4 构建同时覆盖 1.20.3。1.16.5 与 1.18.2 为 Forge 专属。)
? 插件端(无需 mod 加载器):把 zstdnet-bukkit 的 jar 丢进 plugins/ 即可。压缩需要两端配合:想要压缩的玩家仍需安装 ZstdNet 客户端 mod;没装的原版玩家照常直连,不受影响。
? Velocity 代理端(群组服):把 zstdnet-velocity 的 jar 放进 Velocity 的 plugins/,放行它生成的 zstd 入口端口(默认 Velocity 端口 + 1)即可。真实 IP 和正版验证都会自动处理。
⚙️ 必要准备(专用服)
在专用服上使用内置 ZstdNet 服务端入口前,请在后端 server.properties 中至少设置 online-mode=false。如需在离线转发的同时保留正版身份:mod 版用上面的内置正版验证;插件版可搭配 TrueUUID。
? 常用指令
/zstdhud —— 查看 / 切换游戏内 HUD(on / off / toggle)。
/zstdport —— 单机 / 局域网开房时查看或修改端口(show / game / zstd / voice / zstdvoice)。
运行时配置文件位于 config/:客户端 zstdnet-client.toml、服务端 zstdnet-server.properties(自动维护、支持热重载)。
? 致谢与来源
本项目基于原作者 wish 的开源项目 wish131400/zstdnet(MIT License)二次开发,上游的 MIT 版权与许可声明随每个 jar 一同保留;由 xuenai · 麦块联机(minekuai.com) 维护与扩展。
源代码:github.com/xuenaimiao/zstdnet-minekuai。本二次开发版本整体采用 CC BY-NC-SA 4.0 协议(非商用、相同方式共享、保留署名);wish 的原始部分仍为 MIT。
随每个 jar 打包的第三方组件完整声明(LICENSE / NOTICE):zstd-jni(BSD 2-Clause,内含 Meta 的 Zstandard)。「区块引用缓存」的 full / ref / patch 思路借鉴参考 BandwidthOptimizer(LGPL 2.1),但净室自研、未使用其代码。
? Cut your server's public bandwidth to ~1/20. 让你的联机服务器公网带宽省下二十分之一!
? ZstdNet — transparent ZSTD compression for Minecraft multiplayer
In one line: ZstdNet runs a transparent proxy that compresses the client ↔ server traffic with ZSTD in real time. On high-repetition servers it drops public-network bandwidth to roughly 1/20 of the original, and players notice almost nothing.
(中文说明见下方 「中文介绍」。)
⚡ TL;DR
?️ Compresses multiplayer bandwidth down to ~5–20%, cutting public-network usage by 80%+. With auto-takeover on, players keep typing the same IP and port — nothing new to learn. Vanilla players with no mod installed still connect normally and are unaffected.
? Who benefits most
| Scenario |
Why it wins |
| ⚙️ Create-based servers |
Tons of repetitive kinetic data — extremely high compression ratio |
| ? Large modpack servers |
The login registry / tag / recipe burst can be squashed further by the trained dictionary |
| ? FRP / NAT-traversal / tunneled hosting |
Directly saves public traffic and dodges tunnel rate limits |
| ? Solo host opening to LAN |
Give friends a more bandwidth-friendly entry point |
? How dramatic is it, really
Below is a real server-side sample from the large modpack server 齿轮盛宴 ("Gear Feast"). Over the same window the raw traffic had already reached 189 GB, while only 10 GB was actually transmitted after compression:
Raw: 189.06 GB (3.6MB/s) | Zstd: 10.28 GB (252.7KB/s) | Ratio: 5.44% | Conns: 8
Raw: 189.06 GB (5.0MB/s) | Zstd: 10.28 GB (234.3KB/s) | Ratio: 5.44% | Conns: 8
Raw: 189.07 GB (4.8MB/s) | Zstd: 10.28 GB (303.7KB/s) | Ratio: 5.44% | Conns: 8
? Ratio = 5.44% means only about 1/20 of the original traffic actually crosses the public network. Bandwidth bills, FRP traffic and tunnel rate limits all drop with it.
✨ Core features
- ? Auto-takeover, zero learning curve for players — with the default
auto_takeover=true, the mod takes over the original public port and quietly moves the backend MC server to a local port; players keep connecting to the same address.
- ?️ Covers client / dedicated server / solo-to-LAN — dedicated servers, the plugin build, and the host of a singleplayer world "Open to LAN" can all use it.
- ? Built-in live HUD — see at a glance in-game whether ZSTD is active, plus live rate, cumulative traffic, compression ratio and connection count.
- ? Vanilla status-ping passthrough — server lists ping normally and show player count / MOTD.
- ? Same-port UDP passthrough — compatible with mods that rely on Minecraft's same-port UDP, like Sable / Create: Aeronautics.
- ?️ Zero-config voice-mod compatibility — auto-detects the dedicated UDP port of backend Simple Voice Chat / Plasmo Voice and takes it over too; players auto-open the listener on join, the host fills in nothing (works for both mod servers and the plugin). In the default
tunnel mode, voice reuses the single entry port, so FRP / NAT-traversal only has to forward one port.
- ? AutoModpack compatible — AutoModpack 5.x modpack sync works for players joining through ZstdNet; only the server needs ZstdNet 1.4.2-m2.10 or newer.
- ?️ Optional anti-flood guard — on top of the per-IP limits: a global connection cap, global connection / login rate limits with a login lockdown, quick-quit bans and escalating bans. All off by default; enable them in
zstdnet-server.properties.
? Headline: Chunk Reference Cache (CRC, on by default)
For servers that re-send the same chunk over and over (walking in and out of chunks, cross-dimension round-trips, reload after reconnect — very common on Create and big modpacks), ZSTD's sliding window can only fold "recent" repetition. ZstdNet adds a Chunk Reference Cache that stacks on top of ZSTD:
- In-session REF — when the same chunk is sent again this session, only an 8-byte reference token is sent; the client replays the locally cached bytes.
- Cross-session WARM_REF — fully-sent chunks are persisted to disk; chunks still held after a reconnect are sent as a 16-byte token, saving across game sessions.
- Byte-level PATCH — when a chunk changed only slightly, a delta against the held baseline is sent instead of the whole block.
CRC and ZSTD are multiplicative, not either/or: CRC removes the count of repeated chunks, ZSTD compresses the bytes of what remains. It is on by default (chunk_cache=auto) but only ever touches bytes once the connection negotiates support — unsupported / un-upgraded clients get byte-for-byte passthrough, and any runtime anomaly is fail-closed (reconnect, never a wrong packet).
? Advanced compression (all opt-in, off by default)
- ? Long-Distance Matching (LDM) — for servers where "the same big structure recurs within minutes", squeeze the ratio further.
- ? One-switch automatic dictionary — set
dictionary_auto=true on the server: it auto-samples live traffic → trains in the background → hot-enables and pushes the dictionary to players, no restart, no manual distribution. Biggest win on the login registry / tag / recipe burst and on floods of tiny packets.
- ? Entity packet-stream transform — for heavy-entity scenes (Create contraptions, mob farms, raids), reversibly de-interleaves entity movement / metadata before compression to lift the ratio on these scenes.
✅ These are off by default and opt-in. The default config is byte-for-byte identical to historical behavior and stays wire-compatible with un-upgraded clients — if one side hasn't enabled it, that connection silently falls back to plain passthrough.
? Built-in premium (Mojang) verification — no extra mod
ZstdNet can verify genuine accounts itself during login (the access token never leaves the client), so you keep real premium UUIDs/skins on an offline backend while compression stays on — no need to also install TrueUUID. Config premium_verification defaults to auto (follows server.properties online-mode). Available on Fabric / Forge / NeoForge across 1.18.2 ~ 26.3, and on the Velocity plugin. (The Bukkit/Spigot plugin build does not support this — keep the backend online-mode=false there.)
? Supported versions & platforms
Installing on both client and server is recommended.
| Loader |
Versions |
| ? Forge |
1.16.5 / 1.18.2 / 1.19.2 / 1.20.1 |
| ? NeoForge |
1.20.1 / 1.21.1 / 1.21.11 / 26.1 / 26.2 / 26.3 |
| ? Fabric |
1.19.3 / 1.20.1 / 1.20.4 / 1.21.1 / 1.21.11 / 26.1 / 26.2 / 26.3 |
| ? Plugin / hybrid |
Bukkit / Spigot / Paper / Purpur, plus Arclight / Mohist / CatServer (one jar spans 1.20.1 and the latest 1.21.x) |
| ? Velocity proxy |
Velocity 3.4 / 3.5 / 4.x (one jar; backend servers install nothing) |
(The 26.1 / 26.2 / 26.3 builds each cover their whole 26.x line and need Java 25. The 1.21.11 build covers 1.21.11 only. The Fabric 1.20.4 build also covers 1.20.3. 1.16.5 and 1.18.2 are Forge-only.)
? Plugin build (no mod loader): drop the zstdnet-bukkit jar into plugins/. Compression needs both ends — players who want compression still install the ZstdNet client mod; vanilla players without it connect normally and are unaffected.
? Velocity build (networks): drop the zstdnet-velocity jar into Velocity's plugins/ and open the zstd entry port it creates (Velocity port + 1 by default). Real IPs and premium verification are handled automatically.
⚙️ Required setup (dedicated server)
Before using the built-in ZstdNet server entry on a dedicated server, set at least this in the backend server.properties:
online-mode=false
Want premium identity preserved while relaying offline? Use the built-in premium verification above (mod builds), or on the plugin build pair it with TrueUUID.
? Common commands
| Command |
What it does |
/zstdhud |
View / toggle the in-game HUD (on / off / toggle) |
/zstdport |
View or change ports when hosting solo / LAN (show / game / zstd / voice / zstdvoice) |
Runtime config lives in Minecraft's config/: client zstdnet-client.toml, server zstdnet-server.properties (auto-maintained, hot-reloadable).
? What this build adds over the original
This build is a deep fork by xuenai · 麦块联机 (MineKuai) of the original wish131400/zstdnet (MIT). The original already had the ZSTD proxy, auto-takeover, same-port UDP passthrough, HUD and multi-loader support, but only covered 1.20.1 / 1.21.1. On top of that, this build adds:
- ? Far wider versions & platforms — adds Forge 1.16.5 / 1.18.2 / 1.19.2, Fabric 1.19.3 / 1.20.4, 1.21.11 and Minecraft 26.1 / 26.2 / 26.3, plus a plugin / hybrid build (Bukkit / Spigot / Paper / Purpur, Arclight / Mohist), one jar across 1.20.1 and 1.21.x, with Folia support, and a Velocity proxy plugin for networks.
- ?️ Stronger compression — Long-Distance Matching, and a trained dictionary with zero-config auto-distribution (
dictionary_auto=true).
- ? Chunk Reference Cache (on by default) and ? entity packet-stream transform (opt-in) — both negotiated, wire-compatible and fail-closed.
- ?️ Zero-config voice-mod compatibility — auto-detects backend Simple Voice Chat / Plasmo Voice UDP ports (
tunnel / bridge transports).
- ? Built-in premium verification — premium UUIDs on an offline backend without an extra mod.
- ? AutoModpack compatibility and an optional ?️ anti-flood guard (off by default).
CRC is on by default; LDM / dictionary / entity transform are off by default and opt-in, all wire-compatible with un-upgraded clients.
? Credits & license
Built on wish's wish131400/zstdnet (MIT) — that upstream copyright & permission notice is retained inside every jar. Maintained and extended by xuenai · 麦块联机 / MineKuai (minekuai.com).
Source code: github.com/xuenaimiao/zstdnet-minekuai. This build as a whole is licensed CC BY-NC-SA 4.0 (non-commercial, share-alike, keep the credits); wish's original portions remain under MIT.
Bundled third-party components, whose full notices ship inside every jar (LICENSE / NOTICE): zstd-jni (BSD 2-Clause, containing Meta's Zstandard, BSD 2-Clause). The Chunk Reference Cache's full / ref / patch idea is inspired by BandwidthOptimizer (LGPL 2.1) — ZstdNet's implementation is a clean-room rewrite using none of its code.
?? 中文介绍
一句话:把客户端 ↔ 服务端之间的转发流量实时用 ZSTD 压一遍,公网带宽直接砍到原来的 二十分之一 左右,而玩家几乎完全无感。
ZstdNet 用 ZSTD 算法实时压缩客户端与服务端之间的转发流量。在「数据高度重复」的联机场景下大幅削减公网带宽占用。开启自动接管后,玩家继续填原来那个 IP 和端口就行;没装模组的原版玩家也能照常进服,互不影响。
? 它尤其适合谁
| 场景 |
为什么受益 |
| ⚙️ 机械动力(Create)类服务器 |
大量重复的机械运转数据,压缩率极高 |
| ? 大型整合包服务器 |
登录初始的 registry / tag / recipe 爆发可被字典进一步压扁 |
| ? FRP / 内网穿透 / 隧道转发 |
直接省下公网流量与穿透限速 |
| ? 单机开房的房主 |
想给朋友一个更省带宽的入口 |
? 实际效果有多夸张
大型整合包「齿轮盛宴」服务器侧的一组真实统计 —— 同一段时间内原始流量已经跑到 189 GB,压缩后实际只传输了 10 GB:
Raw: 189.06 GB (3.6MB/s) | Zstd: 10.28 GB (252.7KB/s) | Ratio: 5.44% | Conns: 8
Raw: 189.06 GB (5.0MB/s) | Zstd: 10.28 GB (234.3KB/s) | Ratio: 5.44% | Conns: 8
Raw: 189.07 GB (4.8MB/s) | Zstd: 10.28 GB (303.7KB/s) | Ratio: 5.44% | Conns: 8
? Ratio = 5.44%,意味着公网上实际只跑了原始流量的 二十分之一 左右。
✨ 核心特性
- ? 自动接管,玩家零学习成本 —— 默认
auto_takeover=true,模组接管原公网端口、把后端 MC 悄悄挪到本地端口,玩家继续连原地址即可。
- ?️ 客户端 / 服务端 / 单机开房全覆盖 —— 专用服、插件端、以及单机「对局域网开放」的房主都能用。
- ? 内置实时 HUD —— 游戏里一眼看清当前是否在走 ZSTD、实时速率、累计流量、压缩率、连接数。
- ? 原版状态查询透传 —— 服务器列表能正常 ping、显示在线人数和 MOTD。
- ? 同端口 UDP 原样透传 —— 兼容 Sable / 机械动力:航空学这类依赖同端口 UDP 的模组。
- ?️ 语音模组零配置兼容 —— 自动探测后端 Simple Voice Chat / Plasmo Voice 的独立 UDP 端口并一起接管,玩家进服自动开监听,服主无需手填端口。默认
tunnel 模式下语音也复用入口端口这一个口。
- ? 兼容 AutoModpack —— 经 ZstdNet 进服的玩家可以正常用 AutoModpack 5.x 同步整合包,只需服务端升级到 1.4.2-m2.10 及以上。
- ?️ 可选的防刷保护 —— 在单 IP 限制之上,新增全服连接数上限、全服连接 / 登录限速与登录 lockdown、秒退封禁、封禁次数升级。全部默认关闭,按需在
zstdnet-server.properties 里开启。
? 区块引用缓存(CRC,默认开启)
针对「同一个区块被反复下发」的场景(反复进出区块、跨维度往返、重连后重新加载 —— Create 系与大型整合包尤为常见),在 ZSTD 之前把客户端已持有的相同区块换成 8/16 字节令牌(会话内 REF / 跨会话 WARM_REF)或字节级增量(PATCH),与 ZSTD 叠加进一步压低带宽。默认 chunk_cache=auto、协商生效、fail-closed 不损坏数据 —— 不支持的客户端逐字节透传。
? 进阶压缩能力(全部可选,默认关闭)
- ? 长距离匹配(LDM) —— 面向「同样的大结构几分钟内反复出现」的服务器,进一步榨干压缩率。
- ? 一键全自动字典 —— 服务端设
dictionary_auto=true 即可:自动采样 → 后台训练 → 热插启用并下发玩家,无需重启、无需手动分发。
- ? 实体包流变换 —— 面向大量实体 / 生物场景(机械动力契约体、刷怪塔、怪潮),在压缩前做可逆去交错。
✅ 以上选项默认关闭、可选开启;默认配置与历史行为逐字节一致,并对未升级客户端保持线兼容 —— 一端没开就自动回退原样转发。
? 内置正版验证(无需额外装 mod)
ZstdNet 可在登录阶段内置正版账号验证(access token 不出客户端),在离线后端上也能保留真实正版 UUID/皮肤,压缩照常 —— 无需再装 TrueUUID。premium_verification 默认 auto(跟随 server.properties 的 online-mode)。Fabric / Forge / NeoForge(1.18.2 ~ 26.3)与 Velocity 插件全已内置;Bukkit/Spigot 插件端暂不支持,请保持后端 online-mode=false。
? 支持的版本与平台
推荐客户端和服务端都安装。
| 加载器 |
支持版本 |
| ? Forge |
1.16.5 / 1.18.2 / 1.19.2 / 1.20.1 |
| ? NeoForge |
1.20.1 / 1.21.1 / 1.21.11 / 26.1 / 26.2 / 26.3 |
| ? Fabric |
1.19.3 / 1.20.1 / 1.20.4 / 1.21.1 / 1.21.11 / 26.1 / 26.2 / 26.3 |
| ? 插件端 / 混合端 |
Bukkit / Spigot / Paper / Purpur,以及 Arclight / Mohist / CatServer(一个 jar 跨 1.20.1 与 1.21.x) |
| ? Velocity 代理端 |
Velocity 3.4 / 3.5 / 4.x(一个 jar;子服什么都不用装) |
(26.1 / 26.2 / 26.3 构建各自覆盖整条 26.x 线,需要 Java 25。1.21.11 构建只覆盖 1.21.11 本身。Fabric 1.20.4 构建同时覆盖 1.20.3。1.16.5 与 1.18.2 为 Forge 专属。)
? 插件端(无需 mod 加载器):把 zstdnet-bukkit 的 jar 丢进 plugins/ 即可。压缩需要两端配合:想要压缩的玩家仍需安装 ZstdNet 客户端 mod;没装的原版玩家照常直连,不受影响。
? Velocity 代理端(群组服):把 zstdnet-velocity 的 jar 放进 Velocity 的 plugins/,放行它生成的 zstd 入口端口(默认 Velocity 端口 + 1)即可。真实 IP 和正版验证都会自动处理。
⚙️ 必要准备(专用服)
在专用服上使用内置 ZstdNet 服务端入口前,请在后端 server.properties 中至少设置 online-mode=false。如需在离线转发的同时保留正版身份:mod 版用上面的内置正版验证;插件版可搭配 TrueUUID。
? 常用指令
/zstdhud —— 查看 / 切换游戏内 HUD(on / off / toggle)。
/zstdport —— 单机 / 局域网开房时查看或修改端口(show / game / zstd / voice / zstdvoice)。
运行时配置文件位于 config/:客户端 zstdnet-client.toml、服务端 zstdnet-server.properties(自动维护、支持热重载)。
? 致谢与来源
本项目基于原作者 wish 的开源项目 wish131400/zstdnet(MIT License)二次开发,上游的 MIT 版权与许可声明随每个 jar 一同保留;由 xuenai · 麦块联机(minekuai.com) 维护与扩展。
源代码:github.com/xuenaimiao/zstdnet-minekuai。本二次开发版本整体采用 CC BY-NC-SA 4.0 协议(非商用、相同方式共享、保留署名);wish 的原始部分仍为 MIT。
随每个 jar 打包的第三方组件完整声明(LICENSE / NOTICE):zstd-jni(BSD 2-Clause,内含 Meta 的 Zstandard)。「区块引用缓存」的 full / ref / patch 思路借鉴参考 BandwidthOptimizer(LGPL 2.1),但净室自研、未使用其代码。
? Cut your server's public bandwidth to ~1/20. 让你的联机服务器公网带宽省下二十分之一!
评论 0
登录后参与评分
还没有评论,来抢沙发吧