Ever wanted to figure out just how complex and intricate IC2″s power grid really is? Tired of guessing at what all those Thaumcraft items and objects really do? Admire the amazing Steve”s Carts and want to add your own new cart type? Frustrated by trying to understand partially-obfuscated mod code and just want the answers you seek? Read on.
Đang xem: How to decompile a minecraft mod
Important note #1: Do not distribute the decompiled source code of a mod. Mod authors get pissy if you do that, and then you have that piss smell all over the place.
Important note #2: Do not just copy/paste other mods” code into your own. Don”t be a lazy plagiarist.
(When a .bat file is referenced, that is obviously for Windows only. The rest of you should be using the .py (Python) scripts, as usual.)
Now, if you”re very lucky, that will work. What is more likely is you will get an error from Retroguard saying a particular class cannot be found. That means the mod requires something that is not there, and you need to find it.
An example is Mo” Creatures: If you take the MoCreatures.zip out of the Technic 6.0.7 (1.1) installation, and you try to decompile it, Retroguard complains about things like SettingBoolean being missing. In this case, you would go back into your Technic installation, open the modpack.jar, find SettingBoolean.class, and stick that in the minecraft.jar you have in your MCP installation for decompilation.
Repeat that step for each missing class file (this may take a while, as you work your way back through a mod”s entire set of dependencies), and each time, run the decompile.bat script again. (Do not run the cleanup script; There is no need. Just try to decompile again immediately. But if something screws up horribly, go ahead and run the cleanup and see if that helps. Always keep backups at different stages of this process, so all you have to do is copy/paste your directory and start over, instead of re-doing multiple steps.)
Another example may be a missing Forge class: This is an error I encounter frequently, when I install Forge from a download but copy a mod out of Technic to decompile. Just go into your modpack.jar and find it, and put it in. (As far as I know, this is a known issue in Forge that may or may not have already been corrected.)
Remember: The point is not to try to get a working minecraft.jar, but rather, just to get one that decompiles. So once you have the mod you”re trying to decompile in there, it doesn”t matter what else you stick in there, because you will ignore it; All that matters is the mod.
Finally, the decompilation should succeed. MCP will continue through its steps, cleaning up sources and adding comments, and so forth. Once it says it is recompiling, you can CTRL-c (or whatever) out of it, or just wait: It will vomit all over itself and fail to recompile. Ignore that; You have what you need.
Go into the "src" directory, and your decompiled files will be in there, deobfuscated and fresh, ready for you to read and take in. Remember, don”t distribute and don”t plagiarize, but otherwise, learn and grow, and post if you have any issues. I won”t help idiots, but I will help people who genuinely want to learn.
After all, the best way to learn Minecraft modding is to look at Minecraft”s decompiled source code. Mods are just an extension of that.