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
    if (b.tier() < a.tier() - 1) {
       	value -= 2 * (a.tier() - b.tier());
     	}
     	if (b.tier() - 3 > a.tier()) {
       	value -= b.tier() - a.tier();
     	}


    it can be rewritten as follows:

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


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

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