--- a/net/minecraft/network/chat/IChatBaseComponent.java +++ b/net/minecraft/network/chat/IChatBaseComponent.java @@ -35,7 +35,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 { // CraftBukkit + + // CraftBukkit start + default Stream stream() { + return com.google.common.collect.Streams.concat(new Stream[]{Stream.of(this), this.getSiblings().stream().flatMap(IChatBaseComponent::stream)}); + } + + @Override + default Iterator iterator() { + return this.stream().iterator(); + } + // CraftBukkit end ChatModifier getStyle();