#how do i compile a mod without obfuscation?

7 messages · Page 1 of 1 (latest)

tight sandal
#

So, I have a fabric mod (what else, duh) but whenever I compile it, it compiles with obfuscated minecraft classes in mind. The problem is, when in another mod I try to load the compiled jar (URLClassLoader and a bunch of other spaghetti code) and try to invoke a method inside the jar, it crashes, because it can't find class_310 (MinecraftClient). This is only due to this being run in a development environment - meaning the source code isn't obfuscated - but the jar I am loading assumes it is obfuscated. So - is there a easy way to use fabric to remap the jar at runtime - as it does with normal mods in a dev environment, or is there just a way to compile the jar (compiled with fabric too) but without obfuscation?

Any help really appreciated! <3

-# beginner flair used because nothing else matches my problem, really

craggy depot
#

You can turn off remapping, but it's then not going to work outside of a development environment.

#

When using external mods in a dev environment they get remapped to your local mappings. Either via loom (when they are specified in Gradle like Fabric API), or at runtime when you place them in /run/mods.

#

Why do you need your own way of loading jars? Fabric loader already has this sorted for you, and handles remapping.

tight sandal
# craggy depot Why do you need your own way of loading jars? Fabric loader already has this sor...

it's then not going to work outside of a development environment
i know, its just for development

either via loom (when they are specified in Gradle like Fabric API)
so basically, I can put the mod in build.gradle the same way fabric api is, and itll get remapped - makes sense, actually.

Why do you need your own way of loading jars?
I'm basically making a bootstrapper for another mod, which has the benefit of being able to implement an auto-updater, with the benefit of no restart being needed

Anyways, thanks for the help!

craggy depot
tight sandal
#

well, its really not a usual type of mod, i wouldn't add an auto-updater in that case, its really just a utility client, anyways i managed to remap the jar to yarn, it was a bit of a workaround, but it works. all i did was modImplementation files("path/to/file.jar") to dependencies in build.gradle, reload the project, go to build/loom-cache/remapped-working, and retrieved the remapped file from there. and then removed the jar from dependencies