mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-22 16:39:22 +00:00
29 lines
1.4 KiB
Diff
29 lines
1.4 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 87b5571a5ebd11ea6e64565038b1fac331cfba8e..3e5e27efac1791cce961ec144405d8215ab87996 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
|
|
@@ -5,7 +5,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 {
|
|
|
|
@@ -28,7 +28,7 @@ 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
|
|
|
|
@ConfigInfo(baseName = "syncmatica-enabled")
|
|
public static boolean syncmaticaProtocol = false;
|