PaperMC/paper-server/patches/sources/net/minecraft/network/chat/IChatBaseComponent.patch
CraftBukkit/Spigot a265d64138 Move CraftBukkit per-file patches
By: Initial <noreply+automated@papermc.io>
2024-12-11 22:26:36 +01:00

26 lines
915 B
Diff

--- a/net/minecraft/network/chat/IChatBaseComponent.java
+++ b/net/minecraft/network/chat/IChatBaseComponent.java
@@ -38,7 +38,22 @@
import net.minecraft.util.FormattedString;
import net.minecraft.world.level.ChunkCoordIntPair;
-public interface IChatBaseComponent extends Message, IChatFormatted {
+// CraftBukkit start
+import java.util.stream.Stream;
+// CraftBukkit end
+
+public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IChatBaseComponent> { // CraftBukkit
+
+ // CraftBukkit start
+ default Stream<IChatBaseComponent> stream() {
+ return com.google.common.collect.Streams.concat(new Stream[]{Stream.of(this), this.getSiblings().stream().flatMap(IChatBaseComponent::stream)});
+ }
+
+ @Override
+ default Iterator<IChatBaseComponent> iterator() {
+ return this.stream().iterator();
+ }
+ // CraftBukkit end
ChatModifier getStyle();