optimization source code

  • I'm not sure I chose the right forum, but here are the author modification "industrial" ...
    I found a wasteful method of obtaining the difference tier in the "calculateRatioFor"


    Code
    1. if (b.tier() < a.tier() - 1) {
    2. value -= 2 * (a.tier() - b.tier());
    3. }
    4. if (b.tier() - 3 > a.tier()) {
    5. value -= b.tier() - a.tier();
    6. }


    it can be rewritten as follows:

    Code
    1. int tier = a.tier() - b.tier();
    2. if (tier > 1) {
    3. value -= 2 * tier;
    4. }
    5. if ( tier < -3) {
    6. value += tier;
    7. }


    This is small change and the load too small, but I hope the mod will be a little better...

  • I've been wondering for a while now where I can find the source code, preferably with instructions on how to build it? I might try my hand at fixing some things.

  • Closed as in Closed Sourced. I know everybody's opened IC2 in JD-GUI before, but it's probably best not to post IC2 code unless you really have to. It's probably better to PM Player if you want to suggest a change to IC2.

    Help the Official FTB Wiki reach a billion pages! [I had to keep changing it so there ^^]

    Someone should fix the gravel texture in the background. It's been years now, come on people.

  • The closest you can get to the sources are by disassembling or decompiling the developer jar. Personally I disassemble because it is lossless. One example of disassembly is the Class File Editor in Eclipse, if you just try and open an internal class of the IC2 jar from a Forge gradle setup.

  • That's actually not a significant optimization, the compiler may even do it itself.


    I've adopted it anyway to improve readability and fixed the previously broken stat comparison.