9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-30 04:19:13 +00:00
Files
Leaf/patches/server/0037-Faster-Random-for-xaeroMapServerID-generation.patch
2024-12-13 21:19:57 -05: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 a81c0a7bc71b86eb652abcd06099d36f4de71ae9..c17e3484ced6d1fb6083dde7c68f8a5a03de0c4e 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 {
@@ -17,7 +17,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;