mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-03 22:26:19 +00:00
Originally vanilla logic is to use stream, and Mojang switched it to Guava's Collections2 since 1.21.4. It is much faster than using stream or manually adding to a new ArrayList. Manually adding to a new ArrayList requires allocating a new object array. However, the Collections2 lazy handles filter condition on iteration, so much better.
41 lines
2.7 KiB
Diff
41 lines
2.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Blast-MC <cjblanton2@gmail.com>
|
|
Date: Thu, 25 Aug 2022 20:32:01 -0400
|
|
Subject: [PATCH] Parchment: Make FixLight use action bar
|
|
|
|
Original license: GPLv3
|
|
Original project: https://github.com/ProjectEdenGG/Parchment
|
|
|
|
diff --git a/io/papermc/paper/command/subcommands/FixLightCommand.java b/io/papermc/paper/command/subcommands/FixLightCommand.java
|
|
index 85950a1aa732ab8c01ad28bec9e0de140e1a172e..8e8d1a38290c2dc3f88deda64d050e89273a5b89 100644
|
|
--- a/io/papermc/paper/command/subcommands/FixLightCommand.java
|
|
+++ b/io/papermc/paper/command/subcommands/FixLightCommand.java
|
|
@@ -95,17 +95,20 @@ public final class FixLightCommand implements PaperSubcommand {
|
|
((StarLightLightingProvider)lightengine).starlight$serverRelightChunks(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(ONE_DECIMAL_PLACES.get().format(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("(" + ONE_DECIMAL_PLACES.get().format(100.0 * (double) (relitChunks[0]) / (double) pending[0]) + "%)", net.kyori.adventure.text.format.NamedTextColor.YELLOW)
|
|
+ )); // Leaf - Parchment - Make FixLight use action bar
|
|
},
|
|
(final int totalRelit) -> {
|
|
final long end = System.nanoTime();
|
|
sender.getBukkitEntity().sendMessage(text().color(DARK_AQUA).append(
|
|
- text("Relit ", BLUE), text(totalRelit),
|
|
- text(" chunks. Took ", BLUE), text(ONE_DECIMAL_PLACES.get().format(1.0e-6 * (end - start)) + "ms")
|
|
- ));
|
|
+ text("Relit ", DARK_AQUA), text(totalRelit, net.kyori.adventure.text.format.NamedTextColor.YELLOW),
|
|
+ text(" chunks. Took ", DARK_AQUA), text(ONE_DECIMAL_PLACES.get().format(1.0e-6 * (end - start)) + "ms", net.kyori.adventure.text.format.NamedTextColor.YELLOW)
|
|
+ )); // Leaf - Parchment - Make FixLight use action bar
|
|
if (done != null) {
|
|
done.run();
|
|
}
|