User:KungFuHamster

Hello!

You may remember me from such famous How-To articles as "Kung Fu Chicken", and "Changing the Time of Day" (both of which are outdated because of the changes to class and method names from subsequent patches to Minecraft.)

I hang out on irc.esper.net in #risucraft, #mcp, #minecraft, and #mcc and I use the KungFuHamster nick. The #risucraft channel is very friendly and a good place to have a conversation about modding Minecraft. If you've read the information in the Helpful References section and know a little bit about programming (you don't have to be an expert, but we're not a channel for learning programming from scratch) come and join us!

I'm going to try to use this page as my personal notepad to track how I do Minecraft modding, my thoughts on future mods, and so on.

= Decompiling and Recompiling =

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!

= Running Minecraft with a console window for debugging (Windows XP/?) =

start java -Xms1024m -Xmx1024m -Djava.library.path=".\bin\natives" -classpath "bin\minecraft.jar;bin\jinput.jar;bin\lwjgl.jar;bin\lwjgl_util.jar" net.minecraft.client.Minecraft

= Helpful References =


 * Mod Creator Pack Google Spreadsheet: Mostly up-to-date for 1.2.0_02; updated for 1.2.2 but I don't know how long it will stay (I added a new tab)
 * 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
 * MCP Project 1.21 to 1.22 class/method/field map
 * Tutorial for creating a "spring" block with MCP

= Thoughts on a System for Magic Spells in Minecraft =

The thing with creating a system of magic in a game is, you need lots of unique but similar input in order to create a variety of spells. For example, with alchemy, you'd need reagents like flowers, plants, minerals, etc. With a spell book you'd have to be able to write in it or find scrolls randomly in your searches, or something like that.

Maybe you could create a spell vocabulary, and to create a spell you create a scroll like you create a sign; but instead of typing free-form, when you type if you press "a" it comes up with "abra" and if you type "c" it comes up "cad" so a spell would be like "abra" "cad" "abra". You could use pseudo-Latin like the Harry Potter universe, or real Latin like the Ultima series.

So, you could experiment to find new spells, or find scrolls that add spells to your spellbook. Maybe you start the game with one random level 1 spell, like Light or Fireball or Feather Fall.

You could just use paper, and maybe you have to make a magic quill in order to write, and maybe magic ink... or an "ink + quill" item like "flint and steel" is, and it wears out as you use it. What would you use to make a magic quill and ink set? A feather, obviously. Glass for the bottle. What would you use for ink? Red dust? Diamond dust? Gold dust?

UPDATE: I'm in the process of creating a Rune Crafting mod. Details and progress here in the forums

= Patch History Notes =

1.1.2_01 /// ?

1.2.0_02 /// 2010/10/31 Halloween "Boo" update; all class and method names fubar from 1.1.2_01

1.2.1_01 /// 2010/11/05 Fix for armor, redacted mob prevention at depth requiring more light, etc. Only minor differences from 1.2.0_02; most class and method names have remained the same.

1.2.2 /// 2010/11/10 Added support for texture packs; lots of multiplayer fixes. Obfuscation was redone, so all class names are changed when decompiling. UPDATE: another patch, to remove the F4 command to create portals, came a little bit after the previous update. In-game version numbers did not change, but the "version" file inside the jar did.

1.2.3_01 /// 2010/11/24 Supposedly lots of fixes for Survival Multiplayer (SMP) including health, pvp, etc., but we ended up with lots of bugs. Expect a follow-up patch soon.