v1.7.4 - 修复 v1.7.3 mixin 注入失败 / Fix v1.7.3 mixin injection failure
修复 / Bug Fix
修复 v1.7.3 中 entity-lookup-remove-guard mixin 注入失败导致服务器启动崩溃的问题。
Fix entity-lookup-remove-guard mixin injection failure that crashed server startup in v1.7.3.
崩溃信息 / Crash
org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError
Caused by: InjectionError: Critical injection failure:
Redirector fucksable$safeEntityLookupRemove(Lnet/minecraft/world/level/entity/EntityLookup;Lnet/minecraft/world/entity/Entity;)V
in fucksable.mixins.json:PersistentEntitySectionManagerStopTrackingGuardMixin
failed injection check, (0/1) succeeded. Scanned 0 target(s).
根因 / Root Cause
@At 的 target 描述符错误地使用了 Entity 作为参数类型,但 EntityLookup<T extends EntityAccess> 的 remove(T) 和 PersistentEntitySectionManager.stopTracking(T) 在编译后由于 Java 泛型擦除,实际签名是 (Lnet/minecraft/world/level/entity/EntityAccess;)V。mixin 框架在 stopTracking 方法中找不到匹配的 INVOKE 调用点(Scanned 0 targets),抛出 MixinTransformerError,传播到 MinecraftServer.createLevels → ServerLevel.<init>,导致整个服务端启动崩溃。
The @At target descriptor incorrectly used Entity as the parameter type, but EntityLookup<T extends EntityAccess>.remove(T) and PersistentEntitySectionManager.stopTracking(T) are erased to (Lnet/minecraft/world/level/entity/EntityAccess;)V at compile time due to Java generics erasure. Mixin could not find any matching INVOKE site (Scanned 0 targets), throwing MixinTransformerError that propagated to MinecraftServer.createLevels → ServerLevel.<init>, crashing the entire server startup.
修复方式 / How
-
target 描述符从
(Lnet/minecraft/world/level/entity/Entity;)V改为(Lnet/minecraft/world/level/entity/EntityAccess;)V -
handler 方法参数从
Entity改为EntityAccess -
在注释中明确记录泛型擦除约束,避免后续维护时再次踩坑
-
Change target descriptor from
(Lnet/minecraft/world/level/entity/Entity;)Vto(Lnet/minecraft/world/level/entity/EntityAccess;)V -
Change handler parameter type from
EntitytoEntityAccess -
Document the generics-erasure constraint in the mixin class javadoc to prevent future regressions
注意 / Note
v1.7.3 是有问题的版本,请勿使用,请直接升级到 v1.7.4。
v1.7.3 is broken (crashes server at startup), please skip it and use v1.7.4 instead.
产物 / Artifact
FuckSable-Unofficial-1.7.4.jar
环境兼容 / Environment
- Sable 1.x 与 2.x / Sable 1.x and 2.x
- NeoForge 1.21.1
- Mohist/Youer 混合服务端 / Mohist/Youer hybrid servers