craftbukkit/nms-patches/net/minecraft/network/chat/IChatBaseComponent.patch

27 lines
915 B
Diff
Raw Normal View History

2021-03-16 09:00:00 +11:00
--- a/net/minecraft/network/chat/IChatBaseComponent.java
+++ b/net/minecraft/network/chat/IChatBaseComponent.java
2024-06-14 01:05:00 +10:00
@@ -36,7 +36,22 @@
2021-06-11 15:00:00 +10:00
import net.minecraft.util.FormattedString;
2023-12-06 03:40:00 +11:00
import net.minecraft.world.level.ChunkCoordIntPair;
2021-03-09 08:47:33 +11:00
-public interface IChatBaseComponent extends Message, IChatFormatted {
2020-06-25 10:00:00 +10:00
+// CraftBukkit start
+import java.util.stream.Stream;
2021-03-09 08:47:33 +11:00
+// CraftBukkit end
+
+public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IChatBaseComponent> { // CraftBukkit
2020-06-25 10:00:00 +10:00
+
2021-03-09 08:47:33 +11:00
+ // CraftBukkit start
2020-06-25 10:00:00 +10:00
+ default Stream<IChatBaseComponent> stream() {
2023-12-06 03:40:00 +11:00
+ return com.google.common.collect.Streams.concat(new Stream[]{Stream.of(this), this.getSiblings().stream().flatMap(IChatBaseComponent::stream)});
2020-06-25 10:00:00 +10:00
+ }
+
+ @Override
+ default Iterator<IChatBaseComponent> iterator() {
+ return this.stream().iterator();
+ }
+ // CraftBukkit end
2021-11-22 09:00:00 +11:00
ChatModifier getStyle();
2020-06-25 10:00:00 +10:00