#(fixed) no refmap generated upon build

47 messages · Page 1 of 1 (latest)

misty rampart
#

When I build my mod and run it on the base version of Minecraft through modrinth, it completely freaks out and crashes. But running it through the IDE works flawlessly with no issues, and my mixins load and run perfectly fine.
I am unsure if this is the right place for this, but I feel like this issue is too specific. I am a beginner, and I am working on this with an also beginner friend, so we are both clueless.
I have been searching for hours on how to solve this, and nearly every solution I have tried has failed.
I am genuinely curious if I'm doing something totally wrong because its been nearly 2 days since I have been trying to solve this...
My error tells me that I need a refmap, but I do not see one generated when I build:
Caused by: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Critical injection failure: @Inject annotation on update could not find any targets matching 'updateMouse' in net/minecraft/class_312. No refMap loaded. [INJECT_PREPARE Applicator Phase -> marmot.client.mixins.json:MouseMixin from mod marmot -> Prepare Injections -> handler$zpj000$marmot$update(DLorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V -> Parse -> -> Validate Targets]

#

@quasi reef

#

does the fact that my mod is kotlin change anything? my mixins are written in java

quasi reef
misty rampart
#

i have seen many, i just cant remember what they were

#

i dont think i can bring myself to rewrite the entire mod in java

old grove
#

you're not supposed to write mixins in kotlin

#

show your mixin.json

misty rampart
#

i rewrote the mixins in java last night

{
  "required": true,
  "minVersion": "0.8",
  "package": "me.znotchill.marmot.client.mixins",
  "compatibilityLevel": "JAVA_21",
  "injectors": {
    "defaultRequire": 1
  },
  "overwrites": {
    "requireAnnotations": true
  }
}

client mixins:

{
  "required": true,
  "minVersion": "0.8",
  "package": "me.znotchill.marmot.client.mixins",
  "compatibilityLevel": "JAVA_21",
  "client": [
    "GameRendererMixin",
    "MouseMixin",
    "HeldItemRendererMixin",
    "HeldItemRendererMixin"
  ],
  "injectors": {
    "defaultRequire": 1
  },
  "overwrites": {
    "requireAnnotations": true
  },
  "refmap": "marmot.refmap.json"
}
old grove
#

why did you add the "refmap"?

misty rampart
#

idk i've been searching in the discord for so long for a solution I just tried it

#

doesn't seem to make a difference in the error i get

#

should i remove it

old grove
#

yes

#

then do a ./gradlew clean

#

are you getting the error in dev or prod?

misty rampart
#

prod

#

it works flawlessly in dev but as soon as I put it on an actual mc client it just crashes

old grove
#

right

#

do a ./gradlew build and use the generated jar to test again

misty rampart
#

still crashed :p

old grove
#

can you show the mods folder in prod client?

misty rampart
#

they're the same version as the ones in my dev environment i'm pretty sure

org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.8
yarn_mappings=1.21.8+build.1
loader_version=0.17.2
kotlin_loader_version=1.13.6+kotlin.2.2.20
# Mod Properties
mod_version=1.0-SNAPSHOT
maven_group=me.znotchill
archives_base_name=marmot
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.133.4+1.21.8
old grove
#

where did you get the jar file from?

#

build/libs?

misty rampart
#

yes

old grove
#

hmmmm

#

now can you show the mixin that's crashing?

misty rampart
#

its all of them , but this one crashes first:

package me.znotchill.marmot.client.mixins;

import me.znotchill.marmot.client.Client;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.Mouse;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(Mouse.class)
public class MouseMixin {
    @Inject(method = "updateMouse(D)V", at = @At("HEAD"), cancellable = true)
    void update(double timeDelta, CallbackInfo ci) {
        if (Client.cameraLocked) {
            ci.cancel();
        }
    }

    @Inject(method = "onMouseButton(JIII)V", at = @At("HEAD"), cancellable = true)
    void onMouseButton(CallbackInfo ci) {
        MinecraftClient mc = MinecraftClient.getInstance();
        if (Client.mouseButtonsLocked && !Client.emitMouseEvents) {
            if (mc.currentScreen == null) {
                ci.cancel();
            }
        }
    }
}```
#

it says theres no method, but no matter what method I try it doesn't remove the crash

old grove
#

is your project on github?

#

that mixin looks correct

misty rampart
old grove
#

i can have look if you do

misty rampart
old grove
#

i get that error too

#

i can only attribute this to your project structure which not quite common

misty rampart
#

what would you suggest my structure should be?

old grove
#

i'm quite not sure. everything in the mod project looks normal for me

#

the only odd thing is i didn't see a refmap in the final mod jar

misty rampart
#

yeah it’s so confusing, every solution I try just doesn’t work 🥲

stark oasis
#

You might try messing with the mixin block in the loom extension configuration block in build.gradle

#

Potentially try useLegacyMixinAP=false or something

misty rampart
#

no way... that fixed it

#

thank you so much 😭 oh my

#

genuinely thank you man 🙏