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

  • There is a method in net.minecraft.item.Item, that you can override. It's something like shouldRedraw or shouldUpdate (not sure how it's called exactly. Try looking for othetr things, that don't do the update animation, when changed (I think bows and tools do that)

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

  • I guess that is a 1.10.2 thing, because I cant find it in 1.7.10... damnit...

    I don't say, your "insert whatever" is bad. I'm only showing ways for making it better.
    GregTech Website
    Patreon really helps me out. If you consider funding the development of GT, so I might be able to do it fulltime, why not?
    GregTech 6, the Main Thread, Bug Reports go here too.
    I'm also on #gt-dev on irc.esper.net, if you don't want to make a Forum account just to contact me.
    (I'm there almost every day, when I'm at my own computer. Yes you can drop bugs and suggestions there too)

  • 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.

  • 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.

  • Ideally blocks are placed through the associated item's use action against a solid surface as if a regular player was placing it. AFAIK there's no proper API for automated placement.

  • 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

  • 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.