tiny-remapper icon indicating copy to clipboard operation
tiny-remapper copied to clipboard

Remapping Issue

Open haubna opened this issue 3 weeks ago • 0 comments

I tried a mixin for another mod class right here: https://github.com/Traben-0/Entity_Model_Features/blob/e60428246183980aff5428bc53472f76797c21da/src/main/java/traben/entity_model_features/models/parts/EMFModelPart.java#L500

Like this:

@Mixin(EMFModelPart.class)
public class MixinEMFModelPart extends ModelPart {

    public MixinEMFModelPart(List<Cube> list, Map<String, ModelPart> map) {
        super(list, map);
    }

    @Inject(at = @At("HEAD"), method = "compile", cancellable = true, remap = true, require = 1)
    private void physicsmod$renderCuboids(PoseStack.Pose matrices, VertexConsumer vertexConsumer, int light, int overlay, int color, CallbackInfo ci) {

    }
}

In the dev environment everything seems to work fine but with a launcher there seems to be a problem with the remapping. This is the error I get (indicating that it is unable to remap "compile" to the actual ModelPart "compile" from the vanilla class).

Mixin apply for mod physicsmod failed physicsmod.mixins.json:emf.MixinEMFModelPart from mod physicsmod -> traben.entity_model_features.models.parts.EMFModelPart: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException Critical injection failure: @Inject annotation on physicsmod$renderCuboids could not find any targets matching 'compile(Lnet/minecraft/class_4587$class_4665;Lnet/minecraft/class_4588;III)V' in traben/entity_model_features/models/parts/EMFModelPart. No refMap loaded. [handler$bhj001$physicsmod$renderCuboids(Lnet/minecraft/class_4587$class_4665;Lnet/minecraft/class_4588;IIILorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V -> Parse ->  -> Validate Targets]
org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Critical injection failure: @Inject annotation on physicsmod$renderCuboids could not find any targets matching 'compile(Lnet/minecraft/class_4587$class_4665;Lnet/minecraft/class_4588;III)V' in traben/entity_model_features/models/parts/EMFModelPart. No refMap loaded. [handler$bhj001$physicsmod$renderCuboids(Lnet/minecraft/class_4587$class_4665;Lnet/minecraft/class_4588;IIILorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V -> Parse ->  -> Validate Targets]

I tried both Loom 13 and 14 with no success. GauntRecluse from the discord suggested using the old AP like so:

loom {
    mixin {
        useLegacyMixinAp = true
    }
}

Which fixed the issue with loom 14 (didn't try 13). I am using Fabric 1.21.11, Loader 0.18.1 and Fabric API 0.139.4.

haubna avatar Jan 10 '26 13:01 haubna