(1.19) Make timings link clickable (#7897)

This commit is contained in:
Noah van der Aa 2022-06-08 22:27:24 +02:00
parent da6d6a433d
commit 5a7519440e

View file

@ -194,6 +194,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+import com.google.common.collect.Sets; +import com.google.common.collect.Sets;
+import io.papermc.paper.adventure.PaperAdventure; +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.format.NamedTextColor;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; +import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
+import net.minecraft.server.MinecraftServer; +import net.minecraft.server.MinecraftServer;
@ -511,7 +512,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ +
+ timingsURL = con.getHeaderField("Location"); + 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()) { + if (response != null && !response.isEmpty()) {
+ Bukkit.getLogger().log(Level.INFO, "Timing Response: " + response); + Bukkit.getLogger().log(Level.INFO, "Timing Response: " + response);