9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-19 23:09:30 +00:00

Simplify development run JVM arguments

This commit is contained in:
Martijn Muijsers
2023-03-22 16:49:11 +01:00
parent 43611dc086
commit b7fd9efe68
166 changed files with 29 additions and 52 deletions

View File

@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Thu, 22 Dec 2022 15:47:39 +0100
Subject: [PATCH] Server thread priority environment variable
License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ecb20dfad282fd282f937fdf340847086c8dea5b..1df5c36ba713134fdb8dc643ea1df66c4f818125 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -194,6 +194,8 @@ import co.aikar.timings.MinecraftTimings; // Paper
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable {
+ public static final int SERVER_THREAD_PRIORITY = Integer.getInteger("gale.thread.priority.server", 8); // Gale - server thread priority environment variable
+
private static MinecraftServer SERVER; // Paper
public static final Logger LOGGER = LogUtils.getLogger();
public static final String VANILLA_BRAND = "vanilla";
@@ -320,7 +322,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
S s0 = serverFactory.apply(thread); // CraftBukkit - decompile error
atomicreference.set(s0);
- thread.setPriority(Thread.NORM_PRIORITY+2); // Paper - boost priority
+ thread.setPriority(SERVER_THREAD_PRIORITY); // Gale - server thread priority environment variable
thread.start();
return s0;
}