3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00

(1.19) Make timings link clickable (#7897)

Dieser Commit ist enthalten in:
Noah van der Aa 2022-06-08 22:27:24 +02:00 committet von GitHub
Ursprung cbb47cacdb
Commit 9107753202
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -163,10 +163,10 @@ index 0000000000000000000000000000000000000000..b47b7dce26805badd422c1867733ff4b
+}
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
new file mode 100644
index 0000000000000000000000000000000000000000..4092a227a540a1c5cfb95efcc2a36e049b9a979c
index 0000000000000000000000000000000000000000..46297ac0a19fd2398ab777a381eff4d0a256161e
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -0,0 +1,384 @@
@@ -0,0 +1,385 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@ -194,6 +194,7 @@ index 0000000000000000000000000000000000000000..4092a227a540a1c5cfb95efcc2a36e04
+
+import com.google.common.collect.Sets;
+import io.papermc.paper.adventure.PaperAdventure;
+import net.kyori.adventure.text.event.ClickEvent;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
+import net.minecraft.server.MinecraftServer;
@ -511,7 +512,7 @@ index 0000000000000000000000000000000000000000..4092a227a540a1c5cfb95efcc2a36e04
+ }
+
+ timingsURL = con.getHeaderField("Location");
+ listeners.sendMessage(text("View Timings Report: " + timingsURL, NamedTextColor.GREEN));
+ listeners.sendMessage(text("View Timings Report: ", NamedTextColor.GREEN).append(text(timingsURL).clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, timingsURL))));
+
+ if (response != null && !response.isEmpty()) {
+ Bukkit.getLogger().log(Level.INFO, "Timing Response: " + response);
@ -1877,7 +1878,7 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4c939de8822b064f0e44b741c4b3807ba13e5e9e..f43a728eba966992831d040a0ed96f5720d8d15c 100644
index 3ac1d0f7ad41ac66d6061fffe32efd7ea4757653..fcff5e05818c81f72cb6e0f83a683c2bb3979737 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2288,6 +2288,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {