Trouble getting Forge SRC to work with IC²

  • Hi,


    I am currently trying to get a bit into the IC² API however I can't even seem to get Forge to load IC² from Eclipse.


    Steps I've done so far:
    1. Clean MCP install (7.2)
    2. Clean Forge src 4.1.1.251 install
    3. Copied clean Jars/libs
    4. Run Forge install.cmd
    5. Started Eclipse, launched the game, everything works fine
    6. Copied industrialcraft-2_1.106.jar to jars/mods
    7. Launched the game again (from Eclipse), crash:


    Any idea what I am doing wrong?

  • Thinking about it for a while made things clear: if IC² jar references classes by their obfuscated names, but the src obviously de-obfuscates, so the jar cannot access the Eclipse-compiled code as of the different names of the functions.


    That is kind of a downer for IC development, as compiling/re-obfuscating then copying the stuff into the original jar is not only tedious but even if automated takes several seconds to complete and then it is still not debuggable. However to solve this you would need the source code of IC² or at least a non-obfuscated jar to work with.

  • Yeah but that would beat the purpose of being a "Closed Source" project. You just gotta deal with it or pile up your coding and test when you absolutely must do it, not after every little change.


    Closed Source is a relative term, it took me 15 minutes to decompile the IC² jar to get the complete source-code. Now if I would spend some more time to get it to work with Forge that should do it, however having a downloadable version would make things a lot less painful. Decompiling the "Closed Source" Minecraft by the way only takes about 3 minutes thanks to MCP. What defines closed source is just the license on top of it. ;)


    The big question is whether or not the IC team wants modders or just acknowledge the fact that they exist. Since there is an API I guess that they do want them, a logical next step then would be to give out a development version for the sole purpose of being able to use it together with the Eclipse-Forge version. The work here for the team is minimal, as they just need to zip the stuff they have on their hard-disk anyways, and the IMS license still holds true the same way as before.

  • without MCP development of any mod for minecraft will take long time, without forge or similar framework anything is incompatable with anything.


    I suggest you to perform two stage decompilation for better results:


    Forge install on clean jar.
    Decompilation of live jar.
    Copypaste IC2 sources only into clean source.
    Update names.
    Registed workspace in eclipce.
    Work without major issues.



    Quote

    Although that works, that kind of slows down coding by a factor of way-too-much.


    suggest to run code inside your head, this allow to debug ever without running game, this really helps and allow to write code in single run.

  • I suggest you to perform two stage decompilation for better results:


    This was about what I did except for the update names part, which left me with field23423 parts all over the IC code for vanilla functions. Thanks! Going to try that once I am back home.


    suggest to run code inside your head, this allow to debug ever without running game, this really helps and allow to write code in single run.


    This only works as long as said compiler knows how functions work, but if you don't know Minecraft code literally out of your head, the simulation might come up with different results. ;)

    • Official Post

    I dont know if thats exactly what RawCode suggested, but i have a second MCP-Environment just for decompiling Mods. Then I take the desired Source out of it, and put it into my Main-MCP-Setup (the one with the Default-Forge-Install).


    And for testing, i still strongly suggest running it inside the normal Minecraft-Environment instead of the MCP-one. Also it takes only a Minute (for me, and since your decompiling takes also 15 Minutes, like with mine, that should also apply to your Computer), to recompile and reobfuscate the Code, and then i just zip it and put it into the mods-folder. That way i can find more Bugs, than with the MCP-Environment.

  • Closed source to me means "You can't have access to the ORIGINAL source we have, period", yes you can decompile IC2 and Minecraft but how many errors that gives you (And in the case of ic2 how many things you lose), you say it only takes you 5-15min to decompile but thats because of MCP and the really helpful tools they provide. Ever tried to decompile minecraft or ic2 without MCP?


    Not every "Closed Source" code in this world have their own useful "MCP".

  • Closed source to me means "You can't have access to the ORIGINAL source we have, period", yes you can decompile IC2 and Minecraft but how many errors that gives you (And in the case of ic2 how many things you lose), you say it only takes you 5-15min to decompile but thats because of MCP and the really helpful tools they provide. Ever tried to decompile minecraft or ic2 without MCP?


    Not every "Closed Source" code in this world have their own useful "MCP".


    Closed Source just means that you are not allowed to modify, distribute or publish the source code in any form unless permitted by the author. This is a pure license question and not whether or not you actually have the source code. Even though I was able to decompile the source-code, which is by the way thanks to Java almost exactly the same as the IC team has (so no errors or lost stuff), I still cannot just distribute/publish/release it. There are several projects which work under a closed source license even though the source code can be just downloaded for various purposes.


    Yes of course I am using MCP, why wouldn't I? If I had to do it without it might take another 15 minutes to setup the decompiler first. I think you are a little mistaken here on the complexity of doing that with Java code.


    Nevertheless it would be still very helpful if the IC team would release a non-obfuscated JAR for the modders out there.