--- a/net/minecraft/network/chat/IChatBaseComponent.java +++ b/net/minecraft/network/chat/IChatBaseComponent.java @@ -40,7 +40,23 @@ import net.minecraft.util.ChatTypeAdapterFactory; import net.minecraft.util.FormattedString; -public interface IChatBaseComponent extends Message, IChatFormatted { +// CraftBukkit start +import com.google.common.collect.Streams; +import java.util.stream.Stream; +// CraftBukkit end + +public interface IChatBaseComponent extends Message, IChatFormatted, Iterable { // CraftBukkit + + // CraftBukkit start + default Stream stream() { + return 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();