Honestly, the bulk of my time was spent trying to get everything to compile cleanly. The changes were easy compared to that.
Things you'll need:
- Minecraft Coder Pack 4.3
- Nargon's patch to decompile IC2: http://forum.industrial-craft.…read&postID=5558#post5558
- A copy of BuildCraft's 2.1.1 codebase: http://svn.code.sf.net/p/buildcraft/code/tags/2.1.1
- A copy of Minecraft Forge's codebase: http://svn.code.sf.net/p/minecraftforge/code/trunk
- Minecraft jar with just IC2 and its requirements
Here's what I did as best as I can remember. First, set up MCP and put Nargon's patch where it needs to go. Then put your minecraft jar with IC2 where it needs to go and decompile it with the MCP's decompile script. It will throw a bunch of error's when it goes to recompile, but that's to be expected. Forge doesn't decompile cleanly, which is where the svn codebase snapshot comes in. It'll take a bit of slogging through compiler errors, but a couple of forge's files should come up with error messages, I think it was the Configuration and Property classes. Anyway, whichever files the decompile complains about, open up the original, copy the entire class without the package and import statements and paste it over the decompiled class without changing the import and package statements. This is important, because if you change the import and package declarations in the decompiled class, IC2 won't recompile because it will be looking for forge in a different place. My setup also complained about paulscode, which is the sound package. To get around that one, I took the whole paulscode directory from the minecraft jar and put it in the MCPs lib/ directory. Now, to get Buildcraft to compile as well was tricky too, because of the way its repository is structured. There are two directories you need to use, buildcraft_client and common. Dill down in each directory until you find the files. They should be in buildcraft_client/src/net/minecraft/src and common/net/minecraft/src respectively. First, copy everything in the common directory into MCP's src/minecraft/net/minecraft/src directory. Then copy, without overwriting what you just copied, everything in the buildcraft_client directory, essentially combining the two directories. The buildcraft source files have a different path for Forge, so you'll have to go into all the files and change the paths to use the decompiled forge. Mostly taking off the net.minecraft.src. from the import net.minecraft.src.forge.Configuration and import net.minecraft.src.forge.Property statements. Then, recompile, reobfuscate, and you should have a compiled source in MCP's reobf/minecraft dir. I then re-injected the recompiled files I changed into the original buildcraft zipped mod files.
If you want buildcraft to recognize your slots, there's an easier way than modifying buildcraft though. While digging through the code, I noticed that the pipes treat things that implement the ISpecialInventory interface in a special way. The interface includes two methods: addItem() and extractItem(). If you add that interface to your mod, you can then write whatever code you want in those two methods for handling items the buildcraft pipes extract and put into your container. You'll have to include an import statement to ISpecialInventory and have that file in your src/ directory though so you'll still have to add all the buildcraft source files in there. Well, maybe just the ones in the api directory.