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]
#(fixed) no refmap generated upon build
47 messages · Page 1 of 1 (latest)
@quasi reef
does the fact that my mod is kotlin change anything? my mixins are written in java
the fact its kotlin might be an issue, i cant find any mods that uses mixins written in kotlin
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
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"
}
why did you add the "refmap"?
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
prod
it works flawlessly in dev but as soon as I put it on an actual mc client it just crashes
still crashed :p
can you show the mods folder in prod client?
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
yes
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
yes, repo is private though I can make it public
i can have look if you do
i get that error too
i can only attribute this to your project structure which not quite common
what would you suggest my structure should be?
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
yeah it’s so confusing, every solution I try just doesn’t work 🥲