Small diff cleanups from patch updating

And remove a dumb log change in PacketEncoder
This commit is contained in:
Nassim Jahnke
2024-12-17 16:50:59 +01:00
parent 183782ad2e
commit 7caf863b52
25 changed files with 27 additions and 110 deletions

View File

@@ -7,10 +7,10 @@
- ChatDecorator PLAIN = (player, message) -> message;
-
- Component decorate(@Nullable ServerPlayer player, Component message);
+ ChatDecorator PLAIN = (sender, message) -> java.util.concurrent.CompletableFuture.completedFuture(message); // Paper - adventure; support async chat decoration events
+ ChatDecorator PLAIN = (player, message) -> java.util.concurrent.CompletableFuture.completedFuture(message); // Paper - adventure; support async chat decoration events
+
+ @io.papermc.paper.annotation.DoNotUse @Deprecated // Paper - adventure; support chat decoration events (callers should use the overload with CommandSourceStack)
+ java.util.concurrent.CompletableFuture<Component> decorate(@Nullable ServerPlayer sender, Component message); // Paper - adventure; support async chat decoration events
+ java.util.concurrent.CompletableFuture<Component> decorate(@Nullable ServerPlayer player, Component message); // Paper - adventure; support async chat decoration events
+
+ // Paper start - adventure; support async chat decoration events
+ default java.util.concurrent.CompletableFuture<Component> decorate(@Nullable ServerPlayer sender, @Nullable net.minecraft.commands.CommandSourceStack commandSourceStack, Component message) {

View File

@@ -9,7 +9,7 @@
+
+ // CraftBukkit start
+ default java.util.stream.Stream<Component> stream() {
+ return com.google.common.collect.Streams.concat(new java.util.stream.Stream[]{java.util.stream.Stream.of(this), this.getSiblings().stream().flatMap(Component::stream)});
+ return com.google.common.collect.Streams.concat(java.util.stream.Stream.of(this), this.getSiblings().stream().flatMap(Component::stream));
+ }
+
+ @Override