Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change all random calls to a static Random object to ensure proper ra…
…ndomness
- Loading branch information
Showing
7 changed files
with
41 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/net/aufdemrand/denizen/utilities/RandomGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package net.aufdemrand.denizen.utilities; | ||
|
||
import java.util.Random; | ||
|
||
public class RandomGenerator { | ||
|
||
static Random rand = new Random(); | ||
|
||
public static int randInt(int from, int to) { | ||
return rand.nextInt(to - from + 1) + from; | ||
} | ||
|
||
public static int nextInt(int n) { | ||
return rand.nextInt(n); | ||
} | ||
|
||
public static double nextDouble() { | ||
return rand.nextDouble(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters