UniMixins

UniMixins

48.3k Downloads

My mod works in the IDE but not in MultiMC, why?

Lachrymogenic opened this issue ยท 4 comments

commented

Hello! Recently, I've been playing Minecraft, specifically on 1.7.10 as it is my favourite version of the game, however, I noticed that there were some things that I felt like needed tweaking or changing, so I decided to try and get into modding to add those things to make my playthrough on my world more personally enjoyable to me. However, I've come across an issue, the mod works in the IDE but not in game... why?

I'm very new to this and there's not a lot of resources for help with modding for 1.7.10, Forge Forums will shun you if you even mention it because it is unsupported apparently, so I decided that I would ask here, the project that I built the mod on top of in the first place (specifically the unimixins example mod). I'm also aware that some of my mixin code might not be super great, if read by seasoned veterans, but they worked in the IDE, so, I don't get what the issue is.

So here's my code: https://github.com/Lachrymogenic/Lachryvisions

And here's the log file inside of IntelliJ: https://pastebin.com/cwBKqFsb

No problems here. You can see that my custom sign mixin prints are in the log, the game is working as expected... but in MultiMC?
https://pastebin.com/ysAkwk0F

Yeah... I don't know what's going on. I think the jar is not compiling correctly or something, because I've ran a range of tests, I've disabled all of the mixins and only ran the stuff that registers new blocks and crafting recipes... and the game is telling me that it cannot find the classes? Heres an example where all mixins are disabled, just the BlockRegistry and CraftingRegistry are enabled:

https://pastebin.com/WyPn31Es

Help pls

The game cannot find the Minecraft BlockWoodSlab class, so what's going on? When I'm using the IDE, is it directly calling to decompiled Minecraft code which is not allowed? Am I registering things wrong? I've tried everything, I've tried moving the registry stuff from pre init to init to post init and nothing works. Stop the registry stuff and it'll tell me it can't find the Items class, stop the items stuff, stop the custom command registry stuff and the game runs fine, even with some mixins, but the moment you try and trigger a mixin by, say, jumping on a Farmland block, the game crashes ans tells me it cannot find any minecraft related classes.

As much as I love 1.7.10, it really is a pain to mod for. How do I fix this? Thanks.
mfw I make a Minecraft mod and alas, it doesn't actually work, i got april foolsed by Forge and Java.

commented

That's odd, I don't get a crash during loading. I tried both d12a8e4 and 82beffb. To build the mod, all I did was clone the repo and run gradlew build. I recommend trying the same, clone a fresh copy and see if that works.

If it still happens, you want to look at fml-client-latest.log, it's more verbose than the log shown in MultiMC's GUI. There should be something earlier in the log indicating why the class failed to load. You can also drop your jar here if you want me to look at it. Here's mine (built from 82beffb): Lachryvision-1.0.jar.zip

commented

There may have been something wrong with my setup or configuration, I looked online and apparently, deleting your .idea folder fixes it. So, I deleted it and initially it fixed nothing, but when I ran ./gradlew build outside of IntelliJ, it compiles and works flawlessly.

Here is what I did, I deleted the .idea folder, ran ./gradlew build and ./gradlew jar (in IntelliJ terminal because the tasks are broken), nothing changes, thing still refuses to load. Then I closed IntellIj, deleted the jars inside of build/libs folder and ran ./gradlew build again, this time outside of IntelliJ and it just worked.

Very strange, guess it was a cache issue or perhaps a daemon issue or something?
P.S Thank you for your sharp and quick reply.

commented

That's odd, I don't get a crash during loading. I tried both d12a8e4 and 82beffb. To build the mod, all I did was clone the repo and run gradlew build. I recommend trying the same, clone a fresh copy and see if that works.

If it still happens, you want to look at fml-client-latest.log, it's more verbose than the log shown in MultiMC's GUI. There should be something earlier in the log indicating why the class failed to load. You can also drop your jar here if you want me to look at it. Here's mine (built from 82beffb): Lachryvision-1.0.jar.zip

I too was interested actually in why this didn't work, so I decompiled both jars and compared them side by side.
The version that doesn't work has code that differs from the version that does work, here is an example:

corrupt vs not corrupt

So I guess it wasn't obfuscating or mapping properly?
Here's another example

another example of it

commented

Probably a ForgeGradle bug of some kind. The clean task can also help with issues like this. But this is precisely why I recommend using RetroFuturaGradle instead for new projects, FG is a little janky. (I guess I still need to port the example mod to RFG, huh.)