mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-20 15:39:37 +00:00
27 lines
1.3 KiB
Diff
27 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
|
|
Date: Mon, 9 Oct 2023 21:33:08 -0400
|
|
Subject: [PATCH] Faster Random for xaeroMapServerID generation
|
|
|
|
|
|
diff --git a/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java b/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java
|
|
index 8378bab717088b832888be69618f13ba6dd44273..58c2745563b482e9147afa168de72c3ee7a79f0b 100644
|
|
--- a/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java
|
|
+++ b/src/main/java/org/dreeam/leaf/config/modules/network/ProtocolSupport.java
|
|
@@ -4,7 +4,7 @@ import org.dreeam.leaf.config.ConfigInfo;
|
|
import org.dreeam.leaf.config.EnumConfigCategory;
|
|
import org.dreeam.leaf.config.IConfigModule;
|
|
|
|
-import java.util.Random;
|
|
+import java.util.concurrent.ThreadLocalRandom;
|
|
|
|
public class ProtocolSupport implements IConfigModule {
|
|
|
|
@@ -30,5 +30,5 @@ public class ProtocolSupport implements IConfigModule {
|
|
@ConfigInfo(baseName = "xaero-map-protocol")
|
|
public static boolean xaeroMapProtocol = false;
|
|
@ConfigInfo(baseName = "xaero-map-server-id")
|
|
- public static int xaeroMapServerID = new Random().nextInt();
|
|
+ public static int xaeroMapServerID = ThreadLocalRandom.current().nextInt(); // Leaf - Faster Random
|
|
}
|