show a message stating the removal of mojang profiler when running perf comamnd, closes #1591

This commit is contained in:
granny
2024-10-06 17:37:52 -07:00
parent 4565f410fe
commit 4671e1ecfc
2 changed files with 44 additions and 3 deletions

View File

@@ -99,7 +99,7 @@ index e81d0bc309de877ed2b5da6122f55c162e9b5f10..3d663104c8e3089abdb9dc4d7309f873
private static void warnAboutDeprecationOnEnable() {
diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java
index 95d87c9dbf2b237787294dfbe7fed87a36e6dedf..b831a23999c94cb1bdf7f5d2cd719d0b846242ad 100644
index 95d87c9dbf2b237787294dfbe7fed87a36e6dedf..9e165525c4c4c07c783ae2899e07c37ae49ec2de 100644
--- a/src/main/java/co/aikar/timings/TimingsCommand.java
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
@@ -47,7 +47,7 @@ public class TimingsCommand extends BukkitCommand {
@@ -111,22 +111,24 @@ index 95d87c9dbf2b237787294dfbe7fed87a36e6dedf..b831a23999c94cb1bdf7f5d2cd719d0b
this.setPermission("bukkit.command.timings");
}
@@ -56,8 +56,12 @@ public class TimingsCommand extends BukkitCommand {
@@ -56,8 +56,14 @@ public class TimingsCommand extends BukkitCommand {
if (!testPermission(sender)) {
return true;
}
- if (false) {
- sender.sendMessage(Timings.deprecationMessage());
+ // Purpur start
+ if (true) {
+ net.kyori.adventure.text.minimessage.MiniMessage mm = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage();
+ sender.sendMessage(mm.deserialize("<gold>Purpur has removed timings to save your performance. Please use <click:suggest_command:'/spark'><grey>/spark</grey></click> instead"));
+ sender.sendMessage(mm.deserialize("<gold>For more information, view its documentation at"));
+ sender.sendMessage(mm.deserialize("<gold><click:open_url:'https://spark.lucko.me/docs/Command-Usage'>https://spark.lucko.me/docs/Command-Usage</click>"));
+ return true;
+ // Purpur end
}
if (args.length < 1) {
sender.sendMessage(text("Usage: " + this.usageMessage, NamedTextColor.RED));
@@ -117,7 +121,7 @@ public class TimingsCommand extends BukkitCommand {
@@ -117,7 +123,7 @@ public class TimingsCommand extends BukkitCommand {
Preconditions.checkNotNull(args, "Arguments cannot be null");
Preconditions.checkNotNull(alias, "Alias cannot be null");