From 3a7985cb3306668578f2940c6b6d4e832592bff8 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Fri, 16 Dec 2016 09:48:08 +1100 Subject: [PATCH] SPIGOT-1036: Add API to manipulate sendTitle timings. By: md_5 --- .../main/java/org/bukkit/entity/Player.java | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/entity/Player.java b/paper-api/src/main/java/org/bukkit/entity/Player.java index 4fa46f082c..cd36fbbdb2 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Player.java +++ b/paper-api/src/main/java/org/bukkit/entity/Player.java @@ -1121,22 +1121,37 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * values are null, they will not be sent and the display will remain * unchanged. If they are empty strings, the display will be updated as * such. If the strings contain a new line, only the first line will be - * sent. + * sent. The titles will be displayed with the client's default timings. * * @param title Title text * @param subtitle Subtitle text - * @deprecated API subject to change + * @deprecated API behavior subject to change */ @Deprecated public void sendTitle(String title, String subtitle); /** - * Resets the title displayed to the player. - * @deprecated API subject to change. + * Sends a title and a subtitle message to the player. If either of these + * values are null, they will not be sent and the display will remain + * unchanged. If they are empty strings, the display will be updated as + * such. If the strings contain a new line, only the first line will be + * sent. All timings values may take a value of -1 to indicate that they + * will use the last value sent (or the defaults if no title has been + * displayed). + * + * @param title Title text + * @param subtitle Subtitle text + * @param fadeIn time in ticks for titles to fade in. Defaults to 10. + * @param stay time in ticks for titles to stay. Defaults to 70. + * @param fadeOut time in ticks for titles to fade out. Defaults to 20. */ - @Deprecated - public void resetTitle(); + public void sendTitle(String title, String subtitle, int fadeIn, int stay, int fadeOut); + /** + * Resets the title displayed to the player. This will clear the displayed + * title / subtitle and reset timings to their default values. + */ + public void resetTitle(); /** * Spawns the particle (the number of times specified by count)