From 4c5c641e5fbc7502655954c67127b08491158b30 Mon Sep 17 00:00:00 2001 From: Frank van der Heijden Date: Wed, 19 Aug 2020 20:44:58 +0200 Subject: [PATCH] Fix adventure title times --- .../proxy/connection/client/ConnectedPlayer.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 32805b992..455232382 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -308,9 +308,12 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { connection.delayedWrite(titlePkt); TitlePacket timesPkt = TitlePacket.timesForProtocolVersion(this.getProtocolVersion()); - timesPkt.setFadeIn((int) DurationUtils.convertDurationToTicks(title.fadeInTime())); - timesPkt.setStay((int) DurationUtils.convertDurationToTicks(title.stayTime())); - timesPkt.setFadeOut((int) DurationUtils.convertDurationToTicks(title.fadeOutTime())); + net.kyori.adventure.title.Title.Times times = title.times(); + if (times != null) { + timesPkt.setFadeIn((int) DurationUtils.convertDurationToTicks(times.fadeIn())); + timesPkt.setStay((int) DurationUtils.convertDurationToTicks(times.stay())); + timesPkt.setFadeOut((int) DurationUtils.convertDurationToTicks(times.fadeOut())); + } connection.delayedWrite(timesPkt); connection.flush();