Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Item chooseRandItem(int slot, int tier, Random rand) {
- List<Item> itemList = Arrays.asList((Item[])items.keySet().toArray());
- Collections.shuffle(mats);
- Item chosen = itemList.get(rand.nextInt());
- if (items.containsKey(chosen)) {
- int randNum = rand.nextInt(100);
- int chance = items.get(chosen) - (tier - 1) * 5;
- if (randNum < chance) {
- chooseRandItem(slot, tier, rand);
- return null;
- }
- return chosen;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment