Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
24 lines
821 B
Diff
24 lines
821 B
Diff
--- a/net/minecraft/network/chat/Component.java
|
|
+++ b/net/minecraft/network/chat/Component.java
|
|
@@ -23,7 +_,19 @@
|
|
import net.minecraft.util.FormattedCharSequence;
|
|
import net.minecraft.world.level.ChunkPos;
|
|
|
|
-public interface Component extends Message, FormattedText {
|
|
+public interface Component extends Message, FormattedText, Iterable<Component> { // CraftBukkit
|
|
+
|
|
+ // CraftBukkit start
|
|
+ default java.util.stream.Stream<Component> stream() {
|
|
+ return com.google.common.collect.Streams.concat(java.util.stream.Stream.of(this), this.getSiblings().stream().flatMap(Component::stream));
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ default java.util.Iterator<Component> iterator() {
|
|
+ return this.stream().iterator();
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
Style getStyle();
|
|
|
|
ComponentContents getContents();
|