From 81c5c1cc2b88bb51bb607910b0683eb5a8e158a0 Mon Sep 17 00:00:00 2001 From: SashaSemenishchev Date: Mon, 9 Dec 2024 22:41:56 +0100 Subject: [PATCH] Fixed some branding issues --- patches/server/0001-Rebrand.patch | 11 ++++++++- .../server/0007-Async-player-tracker.patch | 23 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/patches/server/0001-Rebrand.patch b/patches/server/0001-Rebrand.patch index 5226f06..c489476 100644 --- a/patches/server/0001-Rebrand.patch +++ b/patches/server/0001-Rebrand.patch @@ -51,9 +51,18 @@ index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..b2c19f1c1650fb10d904797691c624f4 metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { String minecraftVersion = Bukkit.getVersion(); diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index 6d36fc6d8e22d9b68dea3830f6ecc8763184c343..c818edd61a4721bbee6cf10c556dbb2e02ff0268 100644 +index 6d36fc6d8e22d9b68dea3830f6ecc8763184c343..c94b209e011dbff6138f84ab5350e60bd2ed237c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +@@ -36,7 +36,7 @@ public class PaperVersionFetcher implements VersionFetcher { + private static final int DISTANCE_ERROR = -1; + private static final int DISTANCE_UNKNOWN = -2; + // Purpur start +- private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads"; ++ private static final String DOWNLOAD_PAGE = "https://github.com/semenishchev/PurpurLeaf/releases/"; + private static int distance = DISTANCE_UNKNOWN; public int distance() { return distance; } + // Purpur end + @@ -52,7 +52,7 @@ public class PaperVersionFetcher implements VersionFetcher { if (build.buildNumber().isEmpty() && build.gitCommit().isEmpty()) { updateMessage = text("You are running a development version without access to version information", color(0xFF5300)); diff --git a/patches/server/0007-Async-player-tracker.patch b/patches/server/0007-Async-player-tracker.patch index 4e82f68..37864ce 100644 --- a/patches/server/0007-Async-player-tracker.patch +++ b/patches/server/0007-Async-player-tracker.patch @@ -53,6 +53,29 @@ index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..a2c737e0498cd49848ea60cfa95a1ad2 HandlerList handlers = event.getHandlers(); RegisteredListener[] listeners = handlers.getRegisteredListeners(); +diff --git a/src/main/java/me/mrfunny/purpurleaf/PurpurLeafAPI.java b/src/main/java/me/mrfunny/purpurleaf/PurpurLeafAPI.java +index a780d3a43ac67156acc365649c99d851b22178c1..af9cf60c4280cc5bc51995a825ac8f1c229099cc 100644 +--- a/src/main/java/me/mrfunny/purpurleaf/PurpurLeafAPI.java ++++ b/src/main/java/me/mrfunny/purpurleaf/PurpurLeafAPI.java +@@ -12,11 +12,16 @@ public class PurpurLeafAPI { + private static ExecutorService executor; + private static ScheduledExecutorService scheduledExecutor; + public static void init() { ++ int minThreads = 4; ++ int maxThreads = Runtime.getRuntime().availableProcessors() * 2; ++ if(maxThreads < minThreads) { ++ maxThreads = minThreads; ++ } + executor = PurpurleafConfig.virtualThreads + ? Executors.newThreadPerTaskExecutor(new VirtualTickThreadFactory()) + : new ThreadPoolExecutor( +- 4, // considering all processors have hyperthreading, so 4 threads will take exactly 1 full core +- Runtime.getRuntime().availableProcessors() * 2, // we don't really want to have more than 2 threads per logical core ++ minThreads, // considering all processors have hyperthreading, so 4 threads will take exactly 1 full core ++ maxThreads, // we don't really want to have more than 2 threads per logical core + 5L, + TimeUnit.SECONDS, + new LinkedBlockingQueue<>(), diff --git a/src/main/java/me/mrfunny/purpurleaf/config/PurpurleafConfig.java b/src/main/java/me/mrfunny/purpurleaf/config/PurpurleafConfig.java index 0a21da5931d9c308992c24bc7965154a3e37aef3..1a857730be6e03b2f82687cdbdfb4c468dbaff94 100644 --- a/src/main/java/me/mrfunny/purpurleaf/config/PurpurleafConfig.java