patcher: keep Mixin annotations when rewriting handler bodies (fixes dead isSpectator NPE guard) #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/patcher-keep-mixin-annotations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
ReplaceBodyMethodVisitorreturnednullfromvisitAnnotation/visitParameterAnnotation/visitAnnotationDefault, so every method it rewrote lost its annotations. Harmless forAuthorization/LocalizationLoader, fatal forMixinCamera.extractRenderState_isSpectator: the@WrapOperationwas stripped, Mixin never injected the handler, and the null guard shipped in 6.0.1 → 6.0.5 was dead code. Worse, the upstream Axiom wrap disappeared too.Observed 2026-09-05 (Fabric 26.2 client, Ekaxiom 6.0.5):
Vanilla 26.2 has no null check on that line (
this.minecraft.player.isSpectator()), Carpet's@Redirecton the same call site just takes the hit first. Noaxiomframe in the stack = the wrap was not applied.Bytecode diff,
MixinCamera.extractRenderState_isSpectatorannotations:@WrapOperation@WrapOperation+ null guardFix
MethodVisitor.countInjectorAnnotations): re-read the rewritten class and require exactly one runtime-visible injector annotation on the(LocalPlayer, Operation)Zmethod. Completeness check fails the build otherwise, so this regression can't ship again.Verification
Rebuilt 6.0.1 / 6.0.3 / 6.0.5 locally:
NPE-guard injector annotation kept: 1,javap -vshows@WrapOperation(method="extractRenderState", target="LocalPlayer;isSpectator()Z"),ifnonnullguard present, CI smoke test (hasCommercialLicenseiconst_1, zero network refs) OK. Release assets for v6.0.1/6.0.3/6.0.5-unlock to be replaced with the fixed jars.