FakePlayer-CE.Build5
·
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-minimessageare now shaded into the plugin (previouslycompileOnly), so the plugin no longer relies on the server's adventure copy. - Leaf Spawn Fix:
/fp spawnno longer throwsClassCastExceptionon Leaf forks whoseCraftServer#getServer()returns the player list instead of theMinecraftServer.
Critical Fixes
- Fixed Startup
NoClassDefFoundError(Leaf 26.2 + CommandAPI 12.0.0): adventure 4.17 removednet.kyori.adventure.util.UTF8ResourceBundleControl, which devtools still references, and the server's adventure copy is not visible to the plugin classloader. Added a self-containedUTF8ResourceBundleControl(pure JDKResourceBundle.Control, UTF-8 properties) and changed adventure dependencies toimplementationso the plugin shades its own copy. - Fixed
ClassCastExceptionon/fp spawn(Leaf 1.21.11 / 26.2):Reflections.getServer()calledCraftServer.getServer(), which on Leaf forks returns theDedicatedPlayerListrather than theMinecraftServer, causingDedicatedPlayerList cannot be cast to MinecraftServeratNMSServerImpl.<init>. AddedReflections.getMinecraftServer(server, mcServerClass)which resolves theMinecraftServervia its exact-typedconsolefield and only falls back togetServer()when no such field exists. Verified locally:/fp spawncreates 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
- CE Maintenance: @EndlessPixel
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(纯 JDKResourceBundle.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+
鸣谢
- CE 维护: @EndlessPixel