Skip to content

Commit

Permalink
Seeding was preventing randomness within same millisecond
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Dec 12, 2019
1 parent 1072ae0 commit 129bc78
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
public class MagicGenerator
{
private Random random = new Random(System.currentTimeMillis());

/**
* Default constructor. Inits Generator once.
* @param addon Magic Cobblestone Generator addon.
Expand Down Expand Up @@ -62,7 +64,7 @@ public boolean isReplacementGenerated(Block block, boolean improved)
}
else
{
double rand = new Random(System.currentTimeMillis()).nextDouble() * chanceMap.lastKey();
double rand = random.nextDouble() * chanceMap.lastKey();
newMaterial = chanceMap.ceilingEntry(rand).getValue();
}
// Don't use physics
Expand Down

0 comments on commit 129bc78

Please sign in to comment.