Skip to content

FakePlayer-CE.Build5

Choose a tag to compare

@EndlessPixel EndlessPixel released this 11 Sep 09:25
· 178 commits to master since this release

FakePlayer-CE.Build5

Loader & Spawn Compatibility: CommandAPI 12, Adventure 4.x & Leaf Forks
This release makes FakePlayer-CE load and spawn correctly on modern Leaf/Paper forks. It upgrades to CommandAPI 12.0.0, shades a self-contained adventure copy (fixing the UTF8ResourceBundleControl startup crash), and fixes a ClassCastException that broke /fp spawn on Leaf 1.21.11 / 26.2.

Highlights

  • CommandAPI 12.0.0 Support: Updated command argument construction to the new Argument(String, ArgumentType) signature.
  • Self-Contained Adventure: adventure-api / adventure-text-minimessage are now shaded into the plugin (previously compileOnly), so the plugin no longer relies on the server's adventure copy.
  • Leaf Spawn Fix: /fp spawn no longer throws ClassCastException on Leaf forks whose CraftServer#getServer() returns the player list instead of the MinecraftServer.

Critical Fixes

  • Fixed Startup NoClassDefFoundError (Leaf 26.2 + CommandAPI 12.0.0): adventure 4.17 removed net.kyori.adventure.util.UTF8ResourceBundleControl, which devtools still references, and the server's adventure copy is not visible to the plugin classloader. Added a self-contained UTF8ResourceBundleControl (pure JDK ResourceBundle.Control, UTF-8 properties) and changed adventure dependencies to implementation so the plugin shades its own copy.
  • Fixed ClassCastException on /fp spawn (Leaf 1.21.11 / 26.2): Reflections.getServer() called CraftServer.getServer(), which on Leaf forks returns the DedicatedPlayerList rather than the MinecraftServer, causing DedicatedPlayerList cannot be cast to MinecraftServer at NMSServerImpl.<init>. Added Reflections.getMinecraftServer(server, mcServerClass) which resolves the MinecraftServer via its exact-typed console field and only falls back to getServer() when no such field exists. Verified locally: /fp spawn creates a fake player correctly on Leaf 26.2 + CommandAPI 12.0.0.

Usage

  • Java: 21+ (Java 25 recommended for 26.x support)
  • Server: Paper / Leaf 1.20.1+ (Purpur compatible)
  • API: CommandAPI 12.0.0+

Credits


FakePlayer-CE.Build5 —— 加载与生成兼容:CommandAPI 12、Adventure 4.x 与 Leaf 分支

本次更新让 FakePlayer-CE 能在现代的 Leaf / Paper 分支上正常加载并生成假人。我们升级到 CommandAPI 12.0.0,将 adventure 以自包含方式打包(修复 UTF8ResourceBundleControl 启动崩溃),并修复了在 Leaf 1.21.11 / 26.2 上导致 /fp spawn 失败的 ClassCastException。

核心特性

  • 支持 CommandAPI 12.0.0:命令参数构造已更新为新的 Argument(String, ArgumentType) 签名。
  • 自包含 adventure:adventure-api / adventure-text-minimessage 现在被打包进插件(此前为 compileOnly),不再依赖服务端自带的 adventure。
  • 修复 Leaf 生成崩溃:在 CraftServer#getServer() 返回玩家列表而非 MinecraftServer 的 Leaf 分支上,/fp spawn 不再抛出 ClassCastException。

关键修复

  • 修复启动 NoClassDefFoundError(Leaf 26.2 + CommandAPI 12.0.0):adventure 4.17 移除了 net.kyori.adventure.util.UTF8ResourceBundleControl,而 devtools 仍引用该类,且服务端自带的 adventure 对插件类加载器不可见。新增自包含的 UTF8ResourceBundleControl(纯 JDK ResourceBundle.Control,UTF-8 读取 properties),并将 adventure 依赖改为 implementation 打包进插件。
  • 修复 /fp spawn 的 ClassCastException(Leaf 1.21.11 / 26.2):Reflections.getServer() 调用 CraftServer.getServer(),在 Leaf 分支上该方法返回的是 DedicatedPlayerList 而非 MinecraftServer,导致在 NMSServerImpl.<init> 处报 DedicatedPlayerList cannot be cast to MinecraftServer。新增 Reflections.getMinecraftServer(server, mcServerClass),优先按精确类型反射 CraftServer 上的 console 字段获取 MinecraftServer,仅当找不到该字段时才回退到 getServer()。本地实测:在 Leaf 26.2 + CommandAPI 12.0.0 上 /fp spawn 已能正确创建假人。

使用要求

  • Java: 21+ (推荐 Java 25 以支持 26.x)
  • 服务端: Paper / Leaf 1.20.1+ (兼容 Purpur)
  • API: CommandAPI 12.0.0+

鸣谢