9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-26 18:39:23 +00:00
Files
Leaf/patches/server/0036-Faster-Random-for-xaeroMapServerID-generation.patch
2024-06-22 01:15:34 +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 45c422b993e254fd892bfd6f47a074f1e9688714..0a9312fd2235ee350df3bf49e846216714ea1120 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
}