Posts by McFistyBuns

    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:


    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.

    Interestingly enough, I just finished up modifying BuildCraft to recognize the Induction Furnace, mostly just to see what was involved and if I could actually to it. So I give you the BuildCraft/IndustrialCraft cross-over...


    Before you load this, BACK UP YOUR SAVE. Even though I have some general programming experience, I am a complete novice when it comes to Java and the Minecraft/IndustrialCraft/BuildCraft code bases. This was just a learning exercise. So proceed with caution.


    Requirements:
    IndustrialCraft 1.00
    BuildCraft 2.1.1


    Installation:
    - Add the two files to the mods folder, just like you would with buildcraft and delete the original core and transport files if you have them.


    Theoretically, these files should be interchangeable with the originals, so if you want to go back, you just put the originals back in. But like I said, proceed with caution. Also I can't guarantee it will work if you don't use those specific versions because that's what I compiled against.


    Changes:
    - Added Industrial Diamonds to the BuildCraft recipes.
    - Wooden Pipe now recognizes the Induction Furnace specifically. It will pull from the 2 output slots no matter the attached orientation and take from whichever output stack is greater.
    - All other pipes now deliver to the 2 input slots no matter which side they are attached to in the following way:
    1) If both slots are empty, it will split the incoming stack as evenly as it can across both slots.
    2) If one slot is empty and the other is not but contains the same type of item, it will fill the empty one up to match the other one, then split the remaining, if any, across both slots.
    3) If both slots have the same type of item, it will fill the lesser one first and then split the remaining, if any, evenly across both slots.

    Also, i haven't played with engines, but I do know that without engines, the Induction Furnace will outstrip the wooden pipes ability to pull fast enough once the IF hits about 18% or so.


    I also Included the patch of my changes to buildcraft


    Have fun and remember, this was a learning experience for me. Mostly to see if I could actually do it. I figured someone else might enjoy it and decided to share what I did.