mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 10:44:39 +01:00
27 lines
917 B
Diff
27 lines
917 B
Diff
--- a/net/minecraft/network/chat/Component.java
|
|
+++ b/net/minecraft/network/chat/Component.java
|
|
@@ -37,9 +37,23 @@
|
|
import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.util.FormattedCharSequence;
|
|
import net.minecraft.world.level.ChunkPos;
|
|
+// CraftBukkit start
|
|
+import java.util.stream.Stream;
|
|
+// CraftBukkit end
|
|
|
|
-public interface Component extends Message, FormattedText {
|
|
+public interface Component extends Message, FormattedText, Iterable<Component> { // CraftBukkit
|
|
+
|
|
+ // CraftBukkit start
|
|
+ default Stream<Component> stream() {
|
|
+ return com.google.common.collect.Streams.concat(new Stream[]{Stream.of(this), this.getSiblings().stream().flatMap(Component::stream)});
|
|
+ }
|
|
|
|
+ @Override
|
|
+ default Iterator<Component> iterator() {
|
|
+ return this.stream().iterator();
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
Style getStyle();
|
|
|
|
ComponentContents getContents();
|