User:KungFuHamster

Hello!

You may remember me from such famous mods as Kung Fu Chicken, and Changing the Time of Day. I hang out on irc.esper.net in #risucraft, #mcp, #minecraft, and #mcc.

I'm going to try to use this page as my personal notepad to track how I do Minecraft modding, and maybe it will even help someone!

The following are the steps I use to decompile and recompile classes. I use Windows XP and Notepad++ for file editing.


 * Read this thread (Advanced Modding and Mods List) for lots of great information.
 * People say to remove all files in the META-INF folder except MANIFEST.MF (there should only be two files to delete). You may have to delete all of the files in this directory if that doesn't work; I personally delete them all.
 * Create a development directory somewhere (we'll pick an arbitrary one and call it \minedev)
 * Create a subdirectory of \minedev called bin and copy all of the %appdata%\.minecraft\bin\*.jar files into \minedev\bin, including minecraft.jar, lwjgl.jar, lwjgr_util.jar, and jinput.jar
 * Download jad.exe and unzip.exe and put them in \minedev (I got them from the Mod Creator Pack.)
 * Create a bat file called decompile.bat and put the following into it:

@echo off echo UNPACKING MINECRAFT.JAR unzip -o bin\minecraft.jar * -d minecraft >>decompile.log echo DECOMPILING MINECRAFT.JAR jad -f -dead -ff -safe -stat -v -o -s .java -d minecraft.src minecraft\*.class 2>>decompile.log pause
 * 1) decompile.bat -- ripped off from the Mod Creator Pack bat file of the same name.


 * Run decompile.bat. This will create a minecraft.src directory and will decompile all of the classes in the root of the minecraft.jar into it.  Warning: some of it may be wrong and require corrections, and some classes are not included in this!
 * Make a change to a .java file to mod the game, whatever.
 * Recompile it like so:

D:\minedev\minecraft.src>javac -cp ..\bin\minecraft.jar;..\bin\lwjgl.jar;..\bin\lwjgr_util.jar;..\bin\jinput.jar .java


 * Move your brand-spanking new .class file into the original jar. I wrote a small script called jarit.bat to do it for me:

D:\minedev\minecraft.src>jarit .class

jar uMf "%appdata%\.minecraft\bin\minecraft.jar" %1
 * 1) jarit.bat


 * Start up Minecraft and watch it explode into tiny pixels -- or watch your mod actually work! ZOMG!

References:


 * Mod Creator Pack Google Spreadsheet: Mostly up-to-date for 1.2.0_02
 * Advanced Modding Spreadsheet: Outdated; great for 1.1.12, tips, lists, etc.
 * Mod Creator Pack thread on Minecraft forums
 * Advanced Modding thread on Minecraft forums
 * Risugami's mods on Minecraft forums