mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 19:34:09 +01:00
8398e12b34
By: md_5 <git@md-5.net>
26 lines
915 B
Diff
26 lines
915 B
Diff
--- 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<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();
|
|
|