3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-20 21:40:06 +01:00
Paper/patches/removed/1.17/0012-Adventure.patch

23 Zeilen
1.4 KiB
Diff

2021-06-11 21:23:46 +02:00
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);
}