Skip to content

Commit

Permalink
Fixed some branding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
semenishchev committed Dec 9, 2024
1 parent 262d7b2 commit 81c5c1c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
11 changes: 10 additions & 1 deletion patches/server/0001-Rebrand.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
23 changes: 23 additions & 0 deletions patches/server/0007-Async-player-tracker.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 81c5c1c

Please sign in to comment.