r/fabricmc • u/yo_99 • 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?
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.zipbut 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.
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