From 703a1cf8353492f83c8b2c1bfd61bc618254c085 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 16 Dec 2016 09:48:08 +1100 Subject: SPIGOT-1036: Add API to manipulate sendTitle timings. --- src/main/java/org/bukkit/entity/Player.java | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java index 4fa46f08..cd36fbbd 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/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) -- cgit v1.2.3