mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 03:43:40 +01:00
25f3b50f6b
By: md_5 <git@md-5.net>
27 lines
930 B
Diff
27 lines
930 B
Diff
--- 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<IChatBaseComponent> { // CraftBukkit
|
|
+
|
|
+ // CraftBukkit start
|
|
+ default Stream<IChatBaseComponent> stream() {
|
|
+ return 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();
|
|
|