JReiProxyServer
JReiProxyServer 是一个 Paper 插件,它为 JEI 和 REI 客户端提供了模组期望但插件服务器无法提供的服务端功能:服务器的配方数据,以及对模组专属数据包的回答。
自 Minecraft 1.21.2 起,原版服务器不再向客户端发送配方数据。在插件服务器上,这会导致配方查看器显示随客户端附带的默认配方,JEI 也会提示:
此服务器未向 JEI 提供配方。JEI 正在显示来自您客户端的默认配方...
本插件以模组加载器的方式发送这些配方。无需客户端模组,也无需在服务端安装模组加载器。
要求
- Paper、Purpur、Folia 或基于 Minecraft 26.2 的分叉版。该插件针对该版本的服务器内部结构编译,无法在其他版本上加载。
- 拥有 JEI 或 REI 的 Fabric 或 NeoForge 客户端(你的玩家已具备)。Fabric 客户端需要 Minecraft 1.21.10 或更高版本——低于该版本时 Fabric API 的配方同步通道不存在。
功能说明
配方同步。 服务器的配方仅编码一次,并通过每个客户端可读取的频道发送给每位玩家:fabric:recipe_sync(适用于 Fabric)、neoforge:recipe_content(适用于 NeoForge)。REI 通常从配方书构建其列表。当启用完整的 REI 作弊通道时,REI 会故意忽略配方书数据包,因此插件会通过 REI 26.2 版本固定的 sync_displays 协议发送相同的配方。
JEI 在服务端自身配方数据包到达时立即构建其列表(此时任何插件都尚未发送数据),因此它会打印一次警告,随后在片刻后重新加载并使用服务器的配方。该警告不可避免,且并不意味着同步失败;recipe-sync.notify-player 会在其后输出一行说明。
作弊模式。 从列表中取出物品、删除手持物品以及设置快捷栏槽位。完全支持 JEI 和 REI。REI 的完整作弊三件套与其显示同步相结合,保留完整的物品组件(例如光块的等级),而不会丢失服务器配方。如果无法完全编码该显示列表,插件会自动禁用这三件套,并让 REI 回退到安全的配方快捷栏和 /give 命令。由插件处理的作弊数据包受权限节点 jreiproxyserver.cheat 控制。
配方传输。 “+” 按钮,用于将玩家背包中的物品填充至合成网格,适用于 JEI(recipe_transfer、recipe_transfer_counted)和 REI(move_items_new)。各模组的服务端算法被重新实现而非近似模拟:客户端决定使用哪些槽位,但由服务端选择物品并进行移动,因此过期的客户端视图无法复制或凭空生成物品。REI 是否提供该按钮完全取决于服务端是否注册了其通道,因此仅在 recipe-transfer.enabled 开启时才展示。
配方黑名单。 配置文件中列出的配方将从插件发送的所有内容中排除。
版本说明
版本号由所构建对应的 Minecraft 版本加上插件修订号组成:26.2.1 添加了 REI 26.2 显示同步和完整的数据包作弊模式。该 jar 文件针对该版本的服务器内部结构编译,无法在其他版本上加载,因此版本号同时也是兼容性声明。
命令
所有玩家:
/jei(或 /rei,可选带参数 resync / retry)— 请求服务器重新发送配方。适用于登录缓慢导致配方丢失的情况;速率限制由 recipe-sync.player-resync-cooldown-seconds 控制。
管理员(OP):
/jreiproxy reload — 重载配置文件并重新编码配方。
/jreiproxy resync <player|all> — 向其他玩家重新发送配方。
/jreiproxy info — 显示配方数量、负载大小以及各频道已同步的玩家数量。
/jeiproxy 和 /jrp 是 /jreiproxy 的别名。
权限
jreiproxyserver.admin — 上述管理员命令,以及免除 /jei 冷却时间。默认 OP 拥有。
jreiproxyserver.cheat — JEI 和 REI 中的作弊模式。默认 OP 拥有。
配置文件
plugins/JReiProxyServer/config.yml:
| 键 |
说明 |
language |
en 或 zh_cn,或者你在 lang/ 下添加的文件名。 |
recipe-sync.enabled |
主开关。关闭时 JEI 显示客户端自带的配方。 |
recipe-sync.on-join |
玩家加入时发送配方。 |
recipe-sync.on-datapack-reload |
/reload 后重新编码并重新发送。 |
recipe-sync.recipe-book |
谁获得完整的配方书:auto(报告 REI 的客户端)、all 或 off。 |
recipe-sync.trigger-recipe-update |
发送使已加载查看器重新读取配方的数据包。关闭时配方仍会到达,但 JEI 会继续显示客户端默认值。 |
recipe-sync.strip-crafting-requirements |
从配方书条目中省略合成要求。避免因无法解析的物品标签导致客户端被踢出,代价是原版配方书将每个配方视为不可合成,并将其原料留白。默认关闭;仅当客户端确实被踢出时才建议开启。 |
recipe-sync.player-resync-cooldown-seconds |
玩家之间使用 /jei 重新同步必须等待的秒数。0 禁用此限制。 |
recipe-sync.notify-player |
在聊天中告知玩家配方已到达,以便 JEI 之前的警告看起来已过时。措辞位于 lang/ 中。 |
cheat-mode.enabled |
作弊模式的主开关。 |
cheat-mode.rei-channels |
启用三个完整的 REI 作弊通道,并匹配相应的 sync_displays 配方路径。默认开启,需要配方同步和完整的显示负载。如果编码不完整,插件会自动保持该 trio 关闭;传输、热条作弊以及 REI 丢失组件的 /give 回退仍然可用。JEI 不受影响。 |
cheat-mode.allow-creative |
还允许任何创造模式玩家作弊,无论权限如何。 |
recipe-transfer.enabled |
“+”按钮的主开关。 |
recipe-blacklist |
要从所有发送内容中排除的配方 ID(namespace:key)。 |
debug |
记录每个玩家的同步详细信息。 |
插件更新添加的键会在启动时写入现有的 config.yml 和 lang/*.yml 中,并附带注释。你修改过的部分保持不变,如果你的语言文件中缺少某条消息,则回退到 jar 内的副本,而不是显示原始键。
Folia
声明了 folia-supported。每个玩家的工作安排在拥有该玩家的区域线程上执行,而不是在不存在的服务器主线程上,配方数据作为单个不可变快照发布,因此数据包重载不会被观察到半应用状态,并且玩家之间共享的状态是并发安全的。
在实际 Folia 服务器上测试:代码遵循 Folia 的线程规则,并在 Paper API + Folia 上运行。
注意事项
发送整个配方书会使原版配方书将所有内容标记为已知。没有东西在服务端解锁,这也不是漏洞——当玩家点击配方时,服务器仍然检查他们知道什么。使用显示同步的 REI 客户端不需要这种配方书解决方法。
配方携带服务器的内部数字注册表 ID,这些 ID 随每个 Minecraft 版本而变化。与服务器版本不同的玩家无法解码它们。如果你运行 ViaVersion,预计配方同步仅对与服务器版本相同的玩家有效。
REI 的数据包在 Architectury 的分帧打包框架和字节数组信封内传输。客户端到服务端的数据包在大约 32 KB 以上拆分;服务端到客户端的数据包如 sync_displays 在大约 1 MiB 以上拆分。插件处理两个方向。
Fabric 负载仅携带其序列化程序位于 minecraft 命名空间中的配方。Fabric 的解码器在遇到客户端未选择参与的序列化程序时会丢弃整个负载,而该选择参与列表在配置阶段到达,插件无法看到。任何被跳过的内容都会在启动日志中报告。
许可证
MIT — 参见 LICENSE。
配方传输处理是从 JEI 和 REI 移植而来的,两者均采用 MIT 许可,发布的 jar 捆绑了 Kotlin 标准库,采用 Apache 2.0 许可。这些通知位于 THIRD-PARTY-NOTICES.md。
非官方及第三方产品。不与 JEI、REI、Fabric、NeoForge 或 Architectury 的作者有任何关联或背书。
构建
JDK 25 和互联网连接。首次运行时构建会下载一个 Paper 开发包,这需要一些时间。
./gradlew build
jar 文件位于 build/libs 中。
JReiProxyServer
JReiProxyServer is a Paper plugin that gives JEI and REI clients the server half those mods expect but a plugin server cannot provide: the server's recipes, and answers to the mods' own packets.
Since Minecraft 1.21.2 the vanilla server no longer sends recipe data to clients. On a plugin server that leaves a recipe viewer showing the recipes shipped with the client, and JEI says so:
This server does not provide recipes to JEI. JEI is showing default recipes from your client...
This plugin sends them the way a mod loader would. No client mod, no mod loader on the server.
Requirements
- Paper, Purpur, Folia or a fork on Minecraft 26.2. The plugin is compiled against that version's server internals and will not load on another.
- A Fabric or NeoForge client with JEI or REI, as your players already have. Fabric clients need Minecraft 1.21.10 or newer — Fabric API's recipe-sync channel does not exist below that.
What it does
Recipe sync. The server's recipes are encoded once and sent to each player on whichever channel their client can read: fabric:recipe_sync for Fabric, neoforge:recipe_content for NeoForge. REI normally builds its list from the recipe book. When full REI cheat channels are enabled, REI deliberately ignores recipe-book packets, so the plugin sends the same recipes through REI 26.2's version-pinned sync_displays protocol instead.
JEI builds its list the moment the server's own recipe packet arrives, which is before any plugin can send anything, so it prints its warning once and then reloads with the server's recipes a moment later. The warning is unavoidable and does not mean the sync failed; recipe-sync.notify-player follows it with a line saying so.
Cheat mode. Pulling an item out of the list, deleting the held item, and setting a hotbar slot. Fully available for JEI and REI. REI's full cheat trio is paired with its display sync, preserving complete item components such as a light block's level without losing server recipes. If that display list cannot be encoded completely, the plugin automatically keeps the trio disabled and leaves REI on its recipe-safe hotbar and /give fallback. Cheat packets handled by the plugin are gated on jreiproxyserver.cheat.
Recipe transfer. The "+" button that fills a crafting grid from the player's inventory, for both JEI (recipe_transfer, recipe_transfer_counted) and REI (move_items_new). Each mod's own server-side algorithm is reimplemented rather than approximated: the client decides which slots to use, but the server picks the items and moves them, so a stale client view cannot duplicate or void anything. REI decides whether to offer the button purely from whether the server registered its channel, so it is only advertised while recipe-transfer.enabled is on.
Recipe blacklist. Recipes listed in the config are left out of everything the plugin sends.
Versioning
The version is the Minecraft version this is built for, plus a plugin revision: 26.2.1 adds REI 26.2 display sync and full packet cheat mode. The jar is compiled against that version's server internals and will not load on another, so the version number is also the compatibility statement.
Commands
Anyone:
/jei (or /rei, optionally with resync / retry) — ask the server to send the recipes again. Useful when a slow login lost them; rate limited by recipe-sync.player-resync-cooldown-seconds.
Operators:
/jreiproxy reload — reloads the config and re-encodes the recipes.
/jreiproxy resync <player|all> — resends the recipes to someone else.
/jreiproxy info — recipe counts, payload sizes and how many players have been synced on each channel.
/jeiproxy and /jrp are aliases of /jreiproxy.
Permissions
jreiproxyserver.admin — the operator commands above, and exemption from the /jei cooldown. Default OP.
jreiproxyserver.cheat — cheat mode in JEI and REI. Default OP.
Configuration
plugins/JReiProxyServer/config.yml:
| Key |
|
language |
en or zh_cn, or the name of a file you add under lang/. |
recipe-sync.enabled |
Master switch. Off means JEI shows the client's own recipes. |
recipe-sync.on-join |
Send recipes when a player joins. |
recipe-sync.on-datapack-reload |
Re-encode and resend after /reload. |
recipe-sync.recipe-book |
Who gets the full recipe book: auto (clients reporting REI), all, or off. |
recipe-sync.trigger-recipe-update |
Send the packet that makes an already-loaded viewer re-read the recipes. Off means recipes still arrive but JEI keeps showing client defaults. |
recipe-sync.strip-crafting-requirements |
Leave crafting requirements out of recipe-book entries. Avoids a client being dropped over an unresolvable item tag, at the cost of the vanilla recipe book treating every recipe as uncraftable and drawing its ingredients blank. Off by default; only worth turning on if clients are actually being kicked. |
recipe-sync.player-resync-cooldown-seconds |
Seconds a player must wait between /jei resyncs. 0 disables the limit. |
recipe-sync.notify-player |
Tell the player in chat once the recipes have arrived, so JEI's earlier warning reads as out of date. Wording lives in lang/. |
cheat-mode.enabled |
Master switch for cheat mode. |
cheat-mode.rei-channels |
Enable the three full REI cheat channels with the matching sync_displays recipe path. On by default and requires recipe sync plus a complete display payload. If encoding is incomplete, the plugin automatically keeps the trio off; transfer, hotbar cheat, and REI's component-losing /give fallback remain available. JEI is unaffected. |
cheat-mode.allow-creative |
Also let any creative-mode player cheat, regardless of permission. |
recipe-transfer.enabled |
Master switch for the "+" button. |
recipe-blacklist |
Recipe ids (namespace:key) to leave out of everything sent. |
debug |
Log per-player sync details. |
Keys added by a plugin update are written into your existing config.yml and lang/*.yml on startup, with their comments. Anything you changed is left alone, and a message missing from your language file falls back to the copy inside the jar rather than appearing as a raw key.
Folia
Declared folia-supported. Per-player work is scheduled on the region thread owning that player
rather than on a main thread that does not exist there, the recipe data is published as a single
immutable snapshot so a datapack reload cannot be observed half-applied, and the state shared
between players is concurrent.
Tested on an actual Folia server: the code follows Folia's threading rules and runs on Paper API + Folia.
Notes
Sending the whole recipe book makes the vanilla recipe book list everything as known. Nothing is unlocked server-side and it is not an exploit — the server still checks what a player knows when they click a recipe. REI clients using display sync do not need this recipe-book workaround.
Recipes carry the server's internal numeric registry ids, which change with every Minecraft version. A player on a different version than the server cannot decode them. If you run ViaVersion, expect recipe sync to work only for players on the server's own version.
REI's packets travel inside Architectury's split-packet framing and byte-array envelope. Client-to-server packets split above roughly 32 KB; server-to-client packets such as sync_displays split above roughly 1 MiB. The plugin handles both directions.
The Fabric payload only carries recipes whose serializer is in the minecraft namespace. Fabric's decoder discards the entire payload on meeting a serializer the client did not opt into, and that opt-in list arrives in the configuration phase, which a plugin cannot see. Anything skipped is reported in the startup log.
Licence
MIT — see LICENSE.
The recipe-transfer handling is ported from JEI and REI, both MIT licensed, and the released jar
bundles the Kotlin standard library under Apache 2.0. Those notices are in
THIRD-PARTY-NOTICES.md.
Unofficial and third party. Not affiliated with or endorsed by the authors of JEI, REI, Fabric,
NeoForge or Architectury.
Building
JDK 25 and an internet connection. The build downloads a Paper development bundle on first run, which takes a while.
./gradlew build
The jar lands in build/libs.
评论 0
登录后参与评分
还没有评论,来抢沙发吧