Java Random getOreMultiplier(int fortune, Random r)

Here you can find the source of getOreMultiplier(int fortune, Random r)

Description

get Ore Multiplier

License

Open Source License

Declaration

private static int getOreMultiplier(int fortune, Random r) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    private static int getOreMultiplier(int fortune, Random r) {
        switch (fortune) {
        case 1://from  ww w.  j av  a 2  s.  c  o m
            return r.nextInt(3) == 0 ? 2 : 1;
        case 2:
            switch (r.nextInt(4)) {
            case 0:
                return 2;
            case 1:
                return 3;
            default:
                return 1;
            }
        case 3:
            switch (r.nextInt(4)) {
            case 0:
                return 2;
            case 1:
                return 3;
            case 2:
                return 4;
            default:
                return 1;

            }
        default:
            return 1;
        }
    }
}

Related

  1. generateRandom(Integer bitNum)
  2. generateRandomIntegerId()
  3. generateRandomNo()
  4. GenerateRandomPin()
  5. getItemID(Random r)
  6. getPoisson(double lambda, Random rng)
  7. getRandom()
  8. getRandom()
  9. getRandom()