use of net.kyori.adventure.title.Title in project SpongeCommon by SpongePowered.
the class ServerPlayerMixin_API method showTitle.
@Override
public void showTitle(final Title title) {
if (this.impl$isFake) {
return;
}
final Title.Times times = Objects.requireNonNull(title, "title").times();
if (times != null) {
this.connection.send(new ClientboundSetTitlesPacket(this.api$durationToTicks(times.fadeIn()), this.api$durationToTicks(times.stay()), this.api$durationToTicks(times.fadeOut())));
}
this.connection.send(new ClientboundSetTitlesPacket(ClientboundSetTitlesPacket.Type.SUBTITLE, SpongeAdventure.asVanilla(title.subtitle())));
this.connection.send(new ClientboundSetTitlesPacket(ClientboundSetTitlesPacket.Type.TITLE, SpongeAdventure.asVanilla(title.title())));
}
Aggregations