9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-27 10:59:16 +00:00
Files
Leaf/patches/server/0037-Faster-Random-for-xaeroMapServerID-generation.patch
2024-06-30 14:16:41 +08:00

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 0a43d2c4f32a8eebaa25ac55e7dc0e00f3c83943..b06dce4b44b81b2625327841c7fbdeda50963b2e 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 {
@@ -32,5 +32,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
}