3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-14 18:40:10 +01:00

fix adventure patch

Dieser Commit ist enthalten in:
Jake Potrebic 2021-06-11 12:23:46 -07:00 committet von MiniDigger | Martin
Ursprung 9188180d7a
Commit a9f38a8789
3 geänderte Dateien mit 360 neuen und 411 gelöschten Zeilen

Datei anzeigen

@ -0,0 +1,23 @@
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);
}