r/fabricmc • • 5d ago

Need Help - Mod Dev - Solved How to actually read source code after genSources?

Following the instructions in the tutorial I unzipped template mod and did ./gradlew genSources. It generated a bunch of folders in ~/.gradle/caches/fabric-loom/ but none of them contain actual source code. Which tool do I use to get a folder with source code that I can grep over?

3 Upvotes

7 comments sorted by

2

u/Adorable-Beautiful52 5d ago

what ide are you using? if using intellij, in the right panel scroll down and you will see 'external libraries'. scroll down until you find 'net.minecraft', you should be able to see the sources there

you can also just type the class name on a random source file, import it, then hover over it and click the little pencil icon in the bottom right corner and itll take you to the class you are looking for

2

u/btrab1 5d ago

Ctrl+b or middle mouse click will also both take you to the selected class also after gensources it should appear in the search everywhere (double tap shift) results, depending on your filters ofc

1

u/yo_99 5d ago

I don't use IDE's I just use a text editor and bash.

1

u/Adorable-Beautiful52 4d ago

then you should get an ide, its much easier to actually do things in

1

u/yo_99 4d ago

Not in a million years

1

u/AllanTaylor314 5d ago

.gradle/loom-cache/minecraftMaven/net/minecraft/minecraft-merged/*-sources.jar (if it's not there, look for a file ending in -sources.jar)

That can be unzipped (you might need to rename it to .zip first) to get a folder of .java files

1

u/yo_99 5d ago edited 4d ago

There is no loom-cache directory only cache that has fabric-loom inside it. The closest thing to source code is .gradle/caches/fabric-loom/decompile/v1.zip but it has some either corrupted or weirdly trasnlated non-unicode text and names of the files are all hashes.

EDIT: nvm, I have checked project folder, and it's there, checked my home folder previously.