Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

[TOOLKIT] Mod Coder Pack (MCP)

mcp; modding; decompiler; essentials;

  • Please log in to reply
3228 replies to this topic

#1

Searge
    Searge

    Zombie Killer

  • Members
  • 237 posts

Posted 17 October 2010 - 06:28 AM

*
POPULAR

Posted Image

We have moved our releases to the MCP wiki.

The latest version can be found here: Downloads

You can also meet the team and a lot of other cool people in our IRC channel #mcp at irc.esper.net.

To use MCP, you must meet these requirements:
  • You know how to install the latest JDK and add it to the PATH variable on your system
  • You know how to understand and create code in Java
  • You are able to follow instructions in a text file (readme.txt)
  • You only use unmodified minecraft versions without mods with MCP
  • You have patience to wait for new MCP releases after Minecraft updates
  • You look for somebody to help you in IRC channel #mcp on irc.esper.net when everything else fails
  • You don't ask the same question over and over again if you don't get an answer quickly
  • Use the Java6 JDK with MCP, Java7 will not work properly
We still like to hear from you about anything MCP related, but we really need to focus on _real_ problems. Just keep in mind that modding is not trivial and certainly not the best way to try to learn a language like Java. If you don't know the basics, better go learn them and come back to us later.
If you want to contact me, go to http://mcp.ocean-labs.de/

Register or log in to remove.

#2

DrNightKOT
  • Location: The Capital of The Empire of Evil, as they say
  • Minecraft: DrNightKOT

Posted 17 October 2010 - 06:36 AM

Good job will try it out!
First of MILLIONS
If I say fun, I mean fun. If I say FUN, then read the link >:D. It's the in-joke.
Posted Image

#3

Tei
    Tei

    Diamond Miner

  • Members
  • 700 posts

Posted 17 October 2010 - 10:17 AM

AWESOME.

#4

Searge
    Searge

    Zombie Killer

  • Members
  • 237 posts

Posted 17 October 2010 - 02:04 PM

Known bugs so far:
- In the recompiled game the backspace key is not working in text enter fields (like server-IP in MP menu)
If you want to contact me, go to http://mcp.ocean-labs.de/

#5

Tei
    Tei

    Diamond Miner

  • Members
  • 700 posts

Posted 17 October 2010 - 02:08 PM

I made some mods (lame stuff modying the water dynamics), and for some reason the TNT don't work. I don't know if this is a artifact of this system, or the inventary editor I used.

We could use a class generated from this system on the normal .jar file?

#6

Searge
    Searge

    Zombie Killer

  • Members
  • 237 posts

Posted 17 October 2010 - 02:11 PM

Tei said:

We could use a class generated from this system on the normal .jar file?
Yes, you can just use the generated class files like any other mod. Replace some (or all :) ) class files in your jar and you're fine...

Now testing TNT with the recompiled version...
If you want to contact me, go to http://mcp.ocean-labs.de/

#7

ekisde.xp

Posted 17 October 2010 - 02:12 PM

Please coders, make the bloom mod... :S

#8

Searge
    Searge

    Zombie Killer

  • Members
  • 237 posts

Posted 17 October 2010 - 05:55 PM

Version 1.1 is available in the first post. It fixes the TNT bug.
If you want to contact me, go to http://mcp.ocean-labs.de/

#9

Ayutashi

Posted 18 October 2010 - 03:09 AM

This seems great and all, and I appreciate the work put forth, as it seems to work for other people...  However, I feel a bit left out!  I can't seem to get it to work quite right.  The readme file seems straightforward, so I hope I'm not missing something there.

I first tried to decompile and recompile my current, modded client.  I didn't change any files at all, so I figured it should recompile with the Mod Creator Pack easily, right?  Ehhh... no.  Roughly 80-90 errors, it won't compile at all, and seems to be too much work to "touch things up" just to recompile this way.  I also noticed some errors, I -think?- during the decompiling stage.  But I don't know enough about java, or this program, to know if it was a huge deal or not.

After that, I decided to take the original, unmodded client and do the same thing.  Again, plenty of java errors when recompiling.  So I'm a bit at a loss here...

Is there anything that I might be doing wrong that anyone can think of?  I've decompiled and recompiled individual files manually, and worked on some mods on my own, so I don't think it's anything wrong with JDK or javac or whatnot.

It seems that the rest of you are doing just fine, even if there are a few errors while -running- the game.  Unfortunately I can't seem to run the test_game.bat either.  Command prompt starts and ends before I can read anything.

I really like the idea behind this, and it seems simple to use... but I might wait for a few more versions to come out and try it again!  Still, any help is very welcome :3  It might help others out, too.

~Ayutashi's Mods~

TreeDrops | EXchange |Pluckin' Crazy
Custom Mob Spawners | Inverted Half Steps
Timberrrrr! | Jolly Old Saint Notch
Bladed Bows

~Collaboration Projects~
Prefix Skeleton mobs!!  Warp Arrows!!

~Get Dropbox~


#10

Fluiq
    Fluiq

    Forum/Wiki Sponsor

  • Curse Premium
  • 39 posts

Posted 18 October 2010 - 10:44 AM

Tested this by simply decompiling and recompiling, no errors at all. Game runs great.

This saves a lot of time fixing every class by hand.

#11

Tei
    Tei

    Diamond Miner

  • Members
  • 700 posts

Posted 18 October 2010 - 10:51 AM

Ayutashi said:

I first tried to decompile and recompile my current, modded client.  I didn't change any files at all, so I figured it should recompile with the Mod Creator Pack easily, right?  Ehhh... no.  Roughly 80-90 errors, ...

Other people have it working, so must be a problem on your comp.  First thing, use a unmodded jar file, to save you headaches. Then, make sure you have the last version of java, and the bat files are using it, and not some old version floating around on your HD.  Is probably that, you are compiling with a old version.  Also wen reporting, provide as much details as possible: OS/version, java version, and maybe a copypaste of the errors.

#12

Ayutashi

Posted 18 October 2010 - 01:21 PM

Tei said:

Other people have it working, so must be a problem on your comp.  First thing, use a unmodded jar file, to save you headaches. Then, make sure you have the last version of java, and the bat files are using it, and not some old version floating around on your HD.  Is probably that, you are compiling with a old version.  Also wen reporting, provide as much details as possible: OS/version, java version, and maybe a copypaste of the errors.

Ah, well, as I explained earlier, that's the second thing I attempted, was using the original jar, rather than my modded one.  I figured it would work just fine... but... alright, I'll look into the stuff you mentioned :3  I'm really sure I have the latest stable JDK, but I can't remember if I've ever had an older version on here or not.  I'll report back later!  Thanks~

EDIT::

Only one version of Java/JDK on my computer, 1.6.0_21, running Windows XP SP3, and it's all set up correctly.  I found what a few of my problems were, and fixed a couple... but I'm still not quite there yet.

The decompiler in Mod Creator Pack seems to add a bunch of "goto L1"-ish statements within the java files it creates.  I use jd-gui, and it doesn't create code like that while decompiling to java files...  Anyway, the goto statements appear in bf.java for client side, and rt.java for server side.  Also, for bf.java, it seems to be missing a "j" variable declaration (easily fixed) and... something about needing to catch or throw ioexceptions?  Unfortunately that's something I never learned too well in programming, working with exceptions.

Now, I've taken the server.jar out of the equation, and am working on ONLY the original, unmodded client.jar.  I had to take my own jd-gui-created bf.java and copy over the one the MCP created, and it stopped giving me the original errors... however, now it gives me errors on bf.java while creating the .class files!  Again, it's something about ioexceptions, I believe.

I'm really at a loss here.  MCP doesn't seem to decompile a couple of files correctly, and both it and jd-gui seem to be unable to work with the ioexceptions lines very well.

Sorry for the long post... there's really too much more going on here to fix it all in.  I think I'm going to just do everything manually for now -- Even if I figure this stuff out, it'll be a hassle for me to copy the "fixed" files over every single time :\  I'm mostly leaving this here to see if it makes sense to any of you, if it can be patched up for newer versions later on.  It's not a huge deal, anyway, considering the new MC patch is 2 weeks away!

No matter what I was doing wrong, I appreciate the hard work done here :3  I hope MCP helps the rest of you out!

~Ayutashi's Mods~

TreeDrops | EXchange |Pluckin' Crazy
Custom Mob Spawners | Inverted Half Steps
Timberrrrr! | Jolly Old Saint Notch
Bladed Bows

~Collaboration Projects~
Prefix Skeleton mobs!!  Warp Arrows!!

~Get Dropbox~


#13

Searge
    Searge

    Zombie Killer

  • Members
  • 237 posts

Posted 18 October 2010 - 11:08 PM

Ayutashi said:

The decompiler in Mod Creator Pack seems to add a bunch of "goto L1"-ish statements within the java files it creates.  I use jd-gui, and it doesn't create code like that while decompiling to java files...  Anyway, the goto statements appear in bf.java for client side, and rt.java for server side.  Also, for bf.java, it seems to be missing a "j" variable declaration (easily fixed) and... something about needing to catch or throw ioexceptions?  Unfortunately that's something I never learned too well in programming, working with exceptions.
The patches in this package will only work when you use an unmodified .jar file as source. If you still have errors with goto L1, catch/throw Exception ..., it seems that you only decompiled the sources but the 2nd half of my batch file did not run (which is actually applying patches to the source files to fix the errors).

Please open the folder minecraft.src and tell me which of these files exist there: if.java, iffix.java, do.java, dofix.java.

I will change it in the next version so that every tool will write to a logfile. That should make it easier to help in cases where problems like this occur.
If you want to contact me, go to http://mcp.ocean-labs.de/

#14

Searge
    Searge

    Zombie Killer

  • Members
  • 237 posts

Posted 18 October 2010 - 11:27 PM

There is a new version uploaded, see first post.

If you have any problems, please send me the generated mcp.log file. Just zip it and upload it somewhere and post the link here.
If you want to contact me, go to http://mcp.ocean-labs.de/

#15

alecn1519
  • Minecraft: alecn1519

Posted 18 October 2010 - 11:42 PM

Thank you so much for this tool.  I have always had troubles with manually recompiling.  Would you mind if I added this into my tool?  I will give full credits of course.

"We didn't want to go, we didn't want to kill them, but its persistent silence and outstretched arms horrified and comforted us at the same time..."


#16

Ayutashi

Posted 19 October 2010 - 03:38 AM

Searge said:

The patches in this package will only work when you use an unmodified .jar file as source. If you still have errors with goto L1, catch/throw Exception ..., it seems that you only decompiled the sources but the 2nd half of my batch file did not run (which is actually applying patches to the source files to fix the errors).

Please open the folder minecraft.src and tell me which of these files exist there: if.java, iffix.java, do.java, dofix.java.

I will change it in the next version so that every tool will write to a logfile. That should make it easier to help in cases where problems like this occur.

I appreciate the reply... But I didn't get back on here till pretty late ><  I'll have more time to mess with it tomorrow.  If it helps, in the meantime... I believe I -was- using an unmodified .jar source.  It includes if.java, and do.java, but neither of the "-fix.java" files.

Also, you say the batch file/patcher didn't run?  It did seem to act a bit strangely when decompiling.  So maybe that's the problem to begin with.

Anyway, bedtime for now!  Will be back tomorrow with an error log file for you, Searge.

~Ayutashi's Mods~

TreeDrops | EXchange |Pluckin' Crazy
Custom Mob Spawners | Inverted Half Steps
Timberrrrr! | Jolly Old Saint Notch
Bladed Bows

~Collaboration Projects~
Prefix Skeleton mobs!!  Warp Arrows!!

~Get Dropbox~


#17

Advize
    Advize

    Void Walker

  • Members
  • 1530 posts
  • Location: Canada
  • Minecraft: Advize

Posted 19 October 2010 - 06:42 AM

Any reason why some classes get decompiled twice? For example, I sometimes end up with something like:

a.java and a.java.orig

Also, what's changed between 1.1 and 1.2? NVM, found changelog in the readme.

#18

Searge
    Searge

    Zombie Killer

  • Members
  • 237 posts

Posted 19 October 2010 - 07:30 PM

Advize said:

Any reason why some classes get decompiled twice? For example, I sometimes end up with something like:

a.java and a.java.orig

Could you run the current v1.2 scripts to decompile and send me the logfiles?
If you want to contact me, go to http://mcp.ocean-labs.de/

#19

Iggyhopper

Posted 19 October 2010 - 08:10 PM

So this is basically a way to edit source files without some dumb compiler throwing errors at me? If yes, then you're a god.

#20

VoidWhisperer
  • Location: Exploring some cave

Posted 19 October 2010 - 09:21 PM

This is just what I need. I never could figure out h ow to re-compile the .java files into .class when I de-compiled  them
Posted Image
Posted Image