From f82df1c39cecfda927f4c8e5fe688ec703624831 Mon Sep 17 00:00:00 2001 From: chronosacaria Date: Sat, 20 Apr 2024 20:21:52 -0400 Subject: [PATCH] Removed Unsafe Random - Changed from Java's `Random` to `Random.createThreadSafe()` --- .../java/chronosacaria/mcdw/api/util/CleanlinessHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/chronosacaria/mcdw/api/util/CleanlinessHelper.java b/src/main/java/chronosacaria/mcdw/api/util/CleanlinessHelper.java index 98f09589..83e7e73e 100644 --- a/src/main/java/chronosacaria/mcdw/api/util/CleanlinessHelper.java +++ b/src/main/java/chronosacaria/mcdw/api/util/CleanlinessHelper.java @@ -30,6 +30,7 @@ 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; @@ -37,7 +38,8 @@ 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;