2023-02-24 05:13:44 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
Date: Thu, 23 Feb 2023 20:12:48 -0800
|
|
|
|
Subject: [PATCH] Force disable timings
|
|
|
|
|
|
|
|
Need a new profiler system with region threading
|
|
|
|
|
|
|
|
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
|
2024-07-31 05:09:52 +02:00
|
|
|
index e81d0bc309de877ed2b5da6122f55c162e9b5f10..7760c779e97a0e95d5c3d255b25d949ac20df235 100644
|
2023-02-24 05:13:44 +01:00
|
|
|
--- a/src/main/java/co/aikar/timings/Timings.java
|
|
|
|
+++ b/src/main/java/co/aikar/timings/Timings.java
|
2023-03-30 03:30:45 +02:00
|
|
|
@@ -145,13 +145,14 @@ public final class Timings {
|
2023-02-24 05:13:44 +01:00
|
|
|
* @param enabled Should timings be reported
|
|
|
|
*/
|
|
|
|
public static void setTimingsEnabled(boolean enabled) {
|
|
|
|
+ enabled = false; // Folia - region threading - disable timings
|
|
|
|
timingsEnabled = enabled;
|
2023-03-30 03:26:03 +02:00
|
|
|
warnAboutDeprecationOnEnable();
|
2023-02-24 05:13:44 +01:00
|
|
|
reset();
|
2023-03-30 03:30:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private static void warnAboutDeprecationOnEnable() {
|
|
|
|
- if (timingsEnabled && !warnedAboutDeprecationOnEnable) {
|
|
|
|
+ if ((true || timingsEnabled) && !warnedAboutDeprecationOnEnable) { // Folia
|
|
|
|
Bukkit.getLogger().warning(PlainTextComponentSerializer.plainText().serialize(deprecationMessage()));
|
|
|
|
warnedAboutDeprecationOnEnable = true;
|
|
|
|
}
|
|
|
|
@@ -159,8 +160,8 @@ public final class Timings {
|
|
|
|
|
|
|
|
public static Component deprecationMessage() {
|
|
|
|
return Component.text()
|
2024-07-31 05:09:52 +02:00
|
|
|
- .color(TextColor.color(0xffc93a))
|
2023-03-30 03:30:45 +02:00
|
|
|
- .append(Component.text("[!] The timings profiler has been enabled but has been scheduled for removal from Paper in the future."))
|
|
|
|
+ .color(TextColor.color(0xf39195)) // Folia
|
|
|
|
+ .append(Component.text("[!] The timings system cannot be enabled on Folia, and has been scheduled for removal from Paper in the future.")) // Folia
|
|
|
|
.append(Component.newline())
|
2024-07-31 05:09:52 +02:00
|
|
|
.append(Component.text(" We recommend migrating to the spark profiler."))
|
|
|
|
.append(Component.newline())
|
2023-03-30 03:30:45 +02:00
|
|
|
diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java
|
2024-07-31 05:09:52 +02:00
|
|
|
index 95d87c9dbf2b237787294dfbe7fed87a36e6dedf..b83e5ff7ada8771fdf27ba9807c77ba6a4ce12da 100644
|
2023-03-30 03:30:45 +02:00
|
|
|
--- a/src/main/java/co/aikar/timings/TimingsCommand.java
|
|
|
|
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
|
2024-07-31 05:09:52 +02:00
|
|
|
@@ -56,8 +56,9 @@ public class TimingsCommand extends BukkitCommand {
|
2023-03-30 03:30:45 +02:00
|
|
|
if (!testPermission(sender)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
- if (false) {
|
|
|
|
+ if (true) {
|
|
|
|
sender.sendMessage(Timings.deprecationMessage());
|
|
|
|
+ return true;
|
|
|
|
}
|
|
|
|
if (args.length < 1) {
|
|
|
|
sender.sendMessage(text("Usage: " + this.usageMessage, NamedTextColor.RED));
|