[IC2-API] No IUpgradeItem and IUpgradableBlock? Why

  • First of all, i am a German Guy and my English is not the best :D So i hope you understand me.


    Why is the IUpgradeItem and the IUpgradableBlock Interface not included in the API.


    Is there any another way to make a machine using Upgrades? And own Upgrades



    And i will not that my Mod is a dependency of IC2. So the development version as library in eclipse is not an option

  • The reason is because the IC2 Exp api provides all upgradetypes by itself.
    If you want to filter upgrades then make a itemstack check.
    (Items.getItem("Overclocker upgrade")) just an example.
    If you did not understand it just pm me. I will explain it in german then again.

  • You can create it without mod depency.
    At least in exported minecraft.
    Dev invioment would have depencies.
    That is a little bit complex to explain.
    But you change classes by differend modloads.
    If a mod is loaded that you have a depency to you load the classes.
    Else you load placeholder classes ^^"

  • Hmm... I will try it out tomorrow, but what is with the imports. I thought if a class isnt loaded, the imports will crash. And that required a dependency. Or not?

  • That way i told is preventing these but it is kind of complex. It has something todo with class loading by your own.
    So you have these classes in your mod but they will be only loaded if specail cases happens. And that part makes it possible that people could remove these classes and the mod would still run.


    I can not explain it really good but here is an Example:


    Note: this code is 1.6.4 but it depends on no Mod version its java code which means you can copy the loading part without trouble of MC version problems...


    And Aroma before you say that is a bad way to add stuff... Thats based on IC2 code...


    Here is the code: ClickMe


    To explain it:
    Simply when i load these plugins i just say them where the path is and try to load the class. If some imports missing then it catches it and say can not load the plugin you are requesting.
    Also to be extra sure i load the pluginclass which give only the information i need and when i say load plugin then it is calling another class which has the imports which are required. (that is maybe not nessesary but i am sometimes extra carefull about things)


    Note: You can load the plugins any time it does not have to be at the end of MC loading you can do it also at Starting of MC or during the world load, you only need to be sure that you know that a mod is already loaded when you call that^^"

  • Wow, thats a lot of code in your Mod :D


    Can I use your SpmodApi as Library for my mod. There a lot of useful things in it. The Mod is only for me and my friends. I will not release him

  • Also you would with that have a mod dependency... because SpmodAPI is a base mod even with a APIMode you still require that when you want to use the functions ^^"
    At least if you do not implement it fully