Question: How does one go about modding the auto-miner?

  • How do I modify the Auto-miner to change what batteries it will accept?


    What I want to do is modify my IC2 to allow the auto-miner to take Lapotron Crystals.


    Here's what I got so far:
    1) I'm looking in the IC2 zip in the mods folder.
    2) In it, my money is on ContainerMiner.class being the file I want.
    3) I have Java's ClassEditor program to look at the file.



    I was hoping I could see where I would change the code to let it use Lapotron Crystals but I have no idea where to look.

  • F4113nb34st had done something similar in his Advanced Miners mod for 1.23... it has not been updated since, sadly.


    I'd love to once more be able to use miners that could hold a lapotron crystal.

    • Official Post

    I'm not going to actually do it, but it lies in the TileEntityMiner class. This line:


    energy -= ((IChargeableItem)Item.itemsList[inventory[1].itemID]).giveEnergyTo(inventory[1], energy, 2, false);


    Note the highlighted number. That is the "tier" of the battery that it accepts. 1 means Batteries, 2 means Energy Crystals, and 3 means Lapotron Crystals. it will look "down" the tier list.

  • This is getting added as an option with the next IC2 version. No need for a patch.

    That's really good to hear. De-compiling the .class file, finding the number and changing it to a 3 is just the easy part. -Thanks zippinus


    Getting it to re-compile willingly after all the errors because I don't take the time to tell it about the source files is definitely the hard part.


    P.S. as far as I can tell there is no such thing as a Java compiler that will compile and just "ignore the errors."


    One long night and all I have is half done altered files messing up my desktop.(not to mention all the editors)


    It was also a bit Gung-Ho to try and modify one of the most complex machines in IC2 with minimal knowledge of programming, none of which was in Java.

  • it is not possible to recompile ignoring errors


    create new project in eclipse, add minecraft.jar (with everything included into jar) as referenced library, extract source code into new class, fix name and package, it will compile fine, then import it back