PaperMC/paper-server/nms-patches/IChatBaseComponent.patch
CraftBukkit/Spigot b2efd58164 Organise imports
By: md_5 <git@md-5.net>
2021-03-09 08:47:33 +11:00

27 lines
893 B
Diff

--- a/net/minecraft/server/IChatBaseComponent.java
+++ b/net/minecraft/server/IChatBaseComponent.java
@@ -23,7 +23,23 @@
import java.util.Optional;
import javax.annotation.Nullable;
-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 getChatModifier();