Skip to content

Commit

Permalink
Removed Unsafe Random
Browse files Browse the repository at this point in the history
 - Changed from Java's `Random` to `Random.createThreadSafe()`
  • Loading branch information
chronosacaria committed Apr 21, 2024
1 parent e068ce6 commit f82df1c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.random.Random;

import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;

import static chronosacaria.mcdw.Mcdw.CONFIG;

public class CleanlinessHelper {
static final Random random = new Random();
@SuppressWarnings("deprecation")
public static final Random random = Random.createThreadSafe();

public static boolean percentToOccur (int chance) {
return random.nextInt(100) < chance;
Expand Down

0 comments on commit f82df1c

Please sign in to comment.