9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-19 14:59:29 +00:00
Files
Gale/gale-archived-patches/removed/legacy/server/0015-Recommend-disabling-timings-on-startup.patch
2025-01-07 18:39:31 -05:00

61 lines
3.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Wed, 23 Nov 2022 16:02:19 +0100
Subject: [PATCH] Recommend disabling timings on startup
Removed since 1.21
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Disable Paper timings by default"
By: Paul Sauve <paul@technove.co>
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
* Airplane copyright *
Airplane
Copyright (C) 2020 Technove LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index b021721efaab5242b7d174a9c859fe06a5ca6054..65c7a798ae69602f586038ecb2c9ab4f7b968fce 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -97,6 +97,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@Deprecated(forRemoval = true)
public class Timings extends ConfigurationPart {
public boolean enabled = false;
+ public boolean warnIfEnabled = true; // Gale - recommend disabling timings on startup
public boolean verbose = true;
public String url = "https://timin.gs/"; // Gale - use timin.gs by default
public boolean serverNamePrivacy = false;
@@ -110,6 +111,13 @@ public class GlobalConfiguration extends ConfigurationPart {
@PostProcess
private void postProcess() {
+ // Gale start - recommend disabling timings on startup
+ if (enabled && warnIfEnabled) {
+ net.minecraft.server.MinecraftServer.LOGGER.warn("To improve performance, we recommend setting timings.enabled to false in paper-global.yml");
+ net.minecraft.server.MinecraftServer.LOGGER.warn("(If you do this, timings will not start on server startup, but you can still start timings later by using /timings on)");
+ net.minecraft.server.MinecraftServer.LOGGER.warn("If you would like to disable this message, set timings.warn-if-enabled to false in paper-global.yml.");
+ }
+ // Gale end - recommend disabling timings on startup
MinecraftTimings.processConfig(this);
}
}