-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78531a5
commit 8f60ed5
Showing
8 changed files
with
73 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
patches/server/0038-Faster-Random-for-xaeroMapServerID-generation.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java | ||
index d9477d6570ac6bfb9a0256a0dc734b1cfe5ea6c9..bf4c5ce82ecee2e7040d6cea173df7827606a8b8 100644 | ||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java | ||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java | ||
@@ -2,6 +2,7 @@ package org.dreeam.leaf; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
+import java.util.concurrent.ThreadLocalRandom; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.world.entity.EntityType; | ||
import org.bukkit.Bukkit; | ||
@@ -270,7 +271,7 @@ public class LeafConfig { | ||
public static boolean jadeProtocol = false; | ||
public static boolean appleskinProtocol = false; | ||
public static boolean xaeroMapProtocol = false; | ||
- public static int xaeroMapServerID = new Random().nextInt(); | ||
+ public static int xaeroMapServerID = ThreadLocalRandom.current().nextInt(); // Leaf - Faster Random | ||
private static void network() { | ||
jadeProtocol = getBoolean("network.protocol.jade-protocol", jadeProtocol); | ||
appleskinProtocol = getBoolean("network.protocol.appleskin-protocol", appleskinProtocol); |