Here you can find the source of getItemID(Random r)
public static int getItemID(Random r)
//package com.java2s; //License from project: GNU General Public License import java.util.*; public class Main { public static int getItemID(Random r) { return nonUniformRandom(8191, 1, 100000, r); }/* w ww. ja v a 2 s . c o m*/ public static int nonUniformRandom(int x, int min, int max, Random r) { return (((randomNumber(0, x, r) | randomNumber(min, max, r)) + randomNumber( 0, x, r)) % (max - min + 1)) + min; } public static int randomNumber(int min, int max, Random r) { return (int) (r.nextDouble() * (max - min + 1) + min); } }