Dear visitor, welcome to IC² Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Well since it is sortet first by ModName and then Crop name it does effect it really because a G comes before a I so the list which you are using is completly differend then i told. Try it out with Vanilla IC2 Exp...
Well not almost it is impossible. IC2 Has 24 crops. the first 12 he is skipping. If the 13th is not the one you are searching for then he skips a couple others...
Also addition. As long this bug exists i block every version of IC2 Exp that will be higher then 677. (Until it get fixed)
Source code 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
int min = 0; int max = cropsArray.length1; while(min < max) { int currentCheck = (min + max) / 2; int checkValue = pointArray[currentCheck]; if(checkValue >= randomNumber) { max = currentCheck; } else { min = currentCheck + 1; } } 
That's wrong on at least two points:
1. Since the array is size 24 when not using other mods that add crops, it starts with (0+23)/2, which equals 11 (integer division truncates, it doesn't round, at least for positive integers  behavior of dividing negative integers can vary between programming languages). This one's a minor nitpick, though.
2. you seem to be missing the point of the if statement  sometimes it increases the min (technically to 12 for the first iteration) and searches higher next (index 17), but other times it decreases max instead and searches lower next (index 5 for the second iteration in that case).
why not instead adding a few extra points to the total number and let a Random pick the a number and then which one is the closest to it... That would be way easier and also handle all crops... (that have points)
why not instead adding a few extra points to the total number and let a Random pick the a number and then which one is the closest to it... That would be way easier and also handle all crops... (that have points)
I don't really understand what you're suggesting, but the current code is an application of the standard binary search algorithm, so I'm fairly sure it already handles all crops, and will generally have better performance than the sequential search that was used in builds 677 and earlier.
Quoted from "xkcd.com"
BTC 1FhCLQK2ZXtCUQDtG98p6fVH7S6mxAsEey
We did not invent the algorithm. The algorithm consistently finds Jesus. The algorithm killed Jeeves.
The algorithm is banned in China. The algorithm is from Jersey. The algorithm constantly finds Jesus.
This is not the algorithm. This is close.
Quoted from "xkcd.com"
BTC 1FhCLQK2ZXtCUQDtG98p6fVH7S6mxAsEey
We did not invent the algorithm. The algorithm consistently finds Jesus. The algorithm killed Jeeves.
The algorithm is banned in China. The algorithm is from Jersey. The algorithm constantly finds Jesus.
This is not the algorithm. This is close.
Sorry, couldn't stop myself.
Anyways, thanks for the hard work, I appreciate it. If i manage to find some time, which is rather scarce as of now for me, I'll check this out for sure!
Are there Gregtech crops shown too in your Mod ?
If not i would suggest it ;)