IC² API and IC² Addon Creation. (The Code Part)

  • Yeah! I do a simple test that looks OK!:D

  • Is there a good way to place IC2 blocks/machines from code?

    I'm working on an Immersive Engineering multiblock (for Industrial Wires) that has a kinetic generator as one of the parts. I currently use the TE registry name to check whether a block is a kinetic generator (which isn't ideal but works), but I can't think of a reasonably non-hacky way to place them when the multiblock is broken. I could just drop the item, but I ideally want the multiblock to be re-formable easily after breaking.

    • Official Post

    I can't think of any other way right now to detect it.

    To place the block again, you just need to pla ce the correct block ic2:te and the tileentity. (The other properties of the BlockState are overridden by getActualState when the te is present) Ideally, you'd serialize writeToNBT and store it before removing the block and create a new te when breaking the multiblock.

    If you need anything else, or you want me to add a hook, please let me know.

  • Hi guys, I already know how to setup the workspace to start a fresh new mod, but I'm stuck at importing the api to the project. I already read the steps, but I dont really understand this part:

    "Add the IC2 dev jar as a library to the build path. You can get it from http://jenkins.ic2.player.to/job/IC2_experimental/, the file name is "industrialcraft-x-x.x.xxx-experimental-dev.jar" (should be the second one). It also needs to be copied to your eclipse working (run) directory's mods-Folder."


    And searching for the dev build, it looks that the last one looks a bit outdated. I hope you can help me out with this step to start an updated ic2 addon, thanks in advance! :D

    • Official Post

    If you're doing it old school though, the jar you need depends on how much of IC2 you're going to use. For a start the 1.12 ones are here, the old link goes to the 1.6.4 and 1.7 builds.


    If you're just depending on the IC2 API and have no need for any of the internal classes within IC2 (ie any that start with ic2.core) then you will want the -api jar. You download that and link it to your buildpath. To actually run the game from Eclipse when you're testing, you will need the -dev jar to be in the mods folder of where you run the game from (this is the run directory mentioned above).


    If you're depending on all of IC2 (or lazy and only want to download one jar), you want just the -dev jar. You link that one to your buildpath, and it will automatically be loaded as the game is tested without having to put it in the mods folder too.



    Doing it from the build script is less work than doing all this of course, but that's the process in case you need it.

    145 Mods isn't too many. 9 types of copper and 8 types of tin aren't too many. 3 types of coffee though?

    I know that you believe that you understood what you think I said, but I am not sure you realise that what you read was not what I meant.


    ---- Minecraft Crash Report ----
    // I just don't know what went wrong :(


    I see this too much.

    • Official Post

    It's maintenance most likely, it was working two days ago and Player has had no public plans to stop it any time soon. No doubt it will be restored as soon as he's around again to do it. In the meantime you can get the normal builds as well as the API and dev versions from Curse.

    145 Mods isn't too many. 9 types of copper and 8 types of tin aren't too many. 3 types of coffee though?

    I know that you believe that you understood what you think I said, but I am not sure you realise that what you read was not what I meant.


    ---- Minecraft Crash Report ----
    // I just don't know what went wrong :(


    I see this too much.

    • Official Post

    The documentation itself is generated from the API source, so you could always download the API jar from Jenkins and read the .java files directly.

    145 Mods isn't too many. 9 types of copper and 8 types of tin aren't too many. 3 types of coffee though?

    I know that you believe that you understood what you think I said, but I am not sure you realise that what you read was not what I meant.


    ---- Minecraft Crash Report ----
    // I just don't know what went wrong :(


    I see this too much.

  • I assume you output a fluid cell with an NBTTagCompound "fluid" with the type and amount of fluid, although I have never done that, so I may be wrong. Best way to test is to look at the syntax, test and repeat :)