9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-21 15:59:28 +00:00

Updated Upstream (Paper)

This commit is contained in:
Martijn Muijsers
2023-06-14 08:10:05 +02:00
parent 9c8dd899fb
commit 30cbb377e1
94 changed files with 156 additions and 300 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 22891d5c1787c5cdc5d307867ac89196c2b4a7a7..556fca5daf3de2c12a9b30ad7cf8c024ed9ca8ed 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -186,6 +186,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 net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper
@@ -311,7 +313,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;
}