9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-28 03:19:21 +00:00
Files
Leaf/patches/server/0036-Faster-Random-for-xaeroMapServerID-generation.patch
Dreeam 4a06d00973 Refactor: Leaf Config v3 (#81)
* 1

* 2

* 3

* 4

* 5

* 6

* 7

* Change contact info in config

* Add contact info for QQ group

* Add more detailed explanation for configurable connection message config

* Fix comments grammar issues

* Purge old or outdated config on load config

* Clean up
2024-07-12 01:34:15 +08:00

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 1ae8d17c20c1ce661139e4caf348592caef3d81e..46ba1542dad0259f8b823a9dbc99190e2385eb31 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
@Override
public void onLoaded() {