From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> Date: Mon, 13 May 2024 01:00:40 +0300 Subject: [PATCH] Parchment: Make FixLight use action bar Original project: https://github.com/ProjectEdenGG/Parchment diff --git a/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java b/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java index 56524cbe4303901007e1e7fb3703a19efbf79ae7..6eed5653658bfb036e28b9c32c758b7b7b3e9449 100644 --- a/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java +++ b/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java @@ -87,18 +87,21 @@ public final class FixLightCommand implements PaperSubcommand { lightengine.relight(chunks, (final ChunkPos chunkPos) -> { ++relitChunks[0]; - sender.getBukkitEntity().sendMessage(text().color(DARK_AQUA).append( - text("Relit chunk ", BLUE), text(chunkPos.toString()), - text(", progress: ", BLUE), text((int) (Math.round(100.0 * (double) (relitChunks[0]) / (double) pending[0])) + "%") - )); + sender.getBukkitEntity().sendActionBar(text().color(DARK_AQUA).append( + text("Relighting Chunks: ", DARK_AQUA), text(chunkPos.toString()), + text(" " + relitChunks[0], net.kyori.adventure.text.format.NamedTextColor.YELLOW), + text("/", DARK_AQUA), + text(pending[0] + " ", net.kyori.adventure.text.format.NamedTextColor.YELLOW), + text("(" + (int) (Math.round(100.0 * (double) (relitChunks[0]) / (double) pending[0])) + "%)", net.kyori.adventure.text.format.NamedTextColor.YELLOW) + )); // DivineMC // Parchment - Make FixLight use action bar }, (final int totalRelit) -> { final long end = System.nanoTime(); final long diff = Math.round(1.0e-6 * (end - start)); sender.getBukkitEntity().sendMessage(text().color(DARK_AQUA).append( - text("Relit ", BLUE), text(totalRelit), - text(" chunks. Took ", BLUE), text(diff + "ms") - )); + text("Relit ", DARK_AQUA), text(totalRelit, net.kyori.adventure.text.format.NamedTextColor.YELLOW), + text(" chunks. Took ", DARK_AQUA), text(diff + "ms", net.kyori.adventure.text.format.NamedTextColor.YELLOW) + )); // DivineMC // Parchment - Make FixLight use action bar if (done != null) { done.run(); }