How-to: Compile (manually)

View previous topic View next topic Go down

How-to: Compile (manually)

Post  Tei on Fri Oct 15, 2010 3:53 pm

Recompilation guide using Java

Step 1: Locate javac and add it to your %PATH% variable (there are many guides out there if you're not sure how).

Step 2: Set up your development environment by creating a folder somewhere (example: c:\minecraft_dev).

Step 3: Copy all .jar's from the .minecraft/bin/ folder over to c:\minecraft_dev\bin folder. These should include: minecraft.jar, lwjgl.jar, lwjgl_util.jar, jinput.jar

Step 4: Follow the other guides in this thread to decompile whichever file you'd like into .java source code.

Step 5: Make whatever changes you would like to the .java file and save it into the base c:\minecraft_dev folder.

Step 6: Pop open a command prompt / terminal window and change to the folder >cd c:\minecraft_dev

Step 7: Compile the .java file into a class using the following line:
C:\minecraft_dev\> javac -cp bin/minecraft.jar;bin/lwjgl.jar;bin/lwjgl_util.jar;bin/jinput.jar your.java

Step 8: After you've compiled the files you want to edit, add the updated classes to the minecraft.jar in your c:\minecraft_dev\bin folder. If you do not update this file with your new changes, the java linker will ignore any changes you've made when compiling classes.

Step 9: After inserting your class, copy your c:\minecraft_dev\bin\minecraft.jar into your .minecraft/bin folder to update the client with your new code.

An alternative is to put the full path for each of the .jar's listed above in the command line and do all your edits live on the ./minecraft/bin/minecraft.jar.

This should at least compile most of the simple class files provided in the minecraft.jar, although there will still be a good number of files that need manual edits to work.

This method could easily be converted into a batch file or shell script using a console version of zip / winrar to inject compiled class files directly into the jar.

Hope this helps a little.

Tei
Admin

Posts : 32
Join date : 2010-10-15

View user profile http://mcdocs.team-talk.net

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum