9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-21 07:59:26 +00:00
Files
Leaf/patches/server/0039-Faster-Random-for-xaeroMapServerID-generation.patch
Dreeam d4fcc796c6 Add Leaf Bootstrap
Also fixed Ignore terminal provider warning not working
2024-07-31 22:24:37 +08:00

29 lines
1.5 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 1d8d321ac3f6c8bf12afe22d8b3f37655fa8c46c..62fc12c13b8294dab45da4e250bf2e7680744c83 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
@@ -3,7 +3,7 @@ package org.dreeam.leaf.config.modules.network;
import org.dreeam.leaf.config.ConfigModules;
import org.dreeam.leaf.config.EnumConfigCategory;
-import java.util.Random;
+import java.util.concurrent.ThreadLocalRandom;
public class ProtocolSupport extends ConfigModules {
@@ -16,7 +16,7 @@ public class ProtocolSupport extends ConfigModules {
public static boolean asteorBarProtocol = false;
public static boolean chatImageProtocol = false;
public static boolean xaeroMapProtocol = false;
- public static int xaeroMapServerID = new Random().nextInt();
+ public static int xaeroMapServerID = ThreadLocalRandom.current().nextInt(); // Leaf - Faster Random
public static boolean syncmaticaProtocol = false;
public static boolean syncmaticaQuota = false;
public static int syncmaticaQuotaLimit = 40000000;