PaperMC/patches/removed/1.17/0012-Adventure.patch
2021-06-12 03:19:04 +02:00

23 lines
No EOL
1.4 KiB
Diff

diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitlesPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitlesPacket.java
index 915120cc505c70153f7b70f07d8d42c13eb77ea7..69ff8df7340e60c476803256750a48f0b43414d3 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitlesPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitlesPacket.java
@@ -10,6 +10,7 @@ public class ClientboundSetTitlesPacket implements Packet<ClientGamePacketListen
private ClientboundSetTitlesPacket.Type type;
private Component text;
+ public net.kyori.adventure.text.Component adventure$text; // Paper
private int fadeInTime;
private int stayTime;
private int fadeOutTime;
@@ -51,6 +52,11 @@ public class ClientboundSetTitlesPacket implements Packet<ClientGamePacketListen
public void write(FriendlyByteBuf buf) throws IOException {
buf.writeEnum((Enum) this.type);
if (this.type == ClientboundSetTitlesPacket.Type.TITLE || this.type == ClientboundSetTitlesPacket.Type.SUBTITLE || this.type == ClientboundSetTitlesPacket.Type.ACTIONBAR) {
+ // Paper start
+ if (this.adventure$text != null) {
+ buf.writeComponent(this.adventure$text);
+ } else
+ // Paper end
buf.writeComponent(this.text);
}