Package net.caseif.crosstitles
Class TitleUtil
java.lang.Object
net.caseif.crosstitles.TitleUtil
An API for sending titles to players.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Returns whether titles are supported on the current server.Returns theThrowable
preventing title support, if applicable.static void
sendSubtitle
(org.bukkit.entity.Player player, String subtitle, org.bukkit.ChatColor color) Sends a subtitle to a player if one is already displaying; otherwise sets the subtitle to display when a title is next sent.static void
sendTimes
(org.bukkit.entity.Player player, int fadeIn, int stay, int fadeOut) Deprecated.This will not work properly on newer Minecraft versions.static void
Sends a title to a player.static void
sendTitle
(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, int fadeIn, int stay, int fadeOut) Sends a title with the given timing to a player.static void
sendTitle
(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, String subtitle, org.bukkit.ChatColor subColor) Sends a title and subtitle to a player.static void
sendTitle
(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, String subtitle, org.bukkit.ChatColor subColor, int fadeIn, int stay, int fadeOut) Sends a title and subtitle with the given timing to a player.
-
Constructor Details
-
TitleUtil
public TitleUtil()
-
-
Method Details
-
areTitlesSupported
public static boolean areTitlesSupported()Returns whether titles are supported on the current server.- Returns:
- whether titles are supported on the current server
-
getException
Returns theThrowable
preventing title support, if applicable.- Returns:
- The
Throwable
preventing title support, ornull
if titles are supported
-
sendTitle
public static void sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor color) Sends a title to a player.- Parameters:
player
- the player to send the title totitle
- the content of the titlecolor
- the color of the title
-
sendSubtitle
public static void sendSubtitle(org.bukkit.entity.Player player, String subtitle, org.bukkit.ChatColor color) Sends a subtitle to a player if one is already displaying; otherwise sets the subtitle to display when a title is next sent.- Parameters:
player
- the player to send the subtitle tosubtitle
- the content of the subtitlecolor
- the color of the subtitle
-
sendTimes
@Deprecated public static void sendTimes(org.bukkit.entity.Player player, int fadeIn, int stay, int fadeOut) Deprecated.This will not work properly on newer Minecraft versions.Sets the timing for the current title if one is displaying; otherwise sets the timing for the next title sent.- Parameters:
player
- the player to set title timing forfadeIn
- the time in ticks the title should fade in over (default 20)stay
- the time in ticks the title should remain on the screen for between fades (default 60)fadeOut
- the time in ticks the title should fade out over (default 20)
-
sendTitle
public static void sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, String subtitle, org.bukkit.ChatColor subColor) Sends a title and subtitle to a player.- Parameters:
player
- the player to send the title totitle
- the content of the titletitleColor
- the color of the titlesubtitle
- the content of the subtitlesubColor
- the color of the subtitle
-
sendTitle
public static void sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, String subtitle, org.bukkit.ChatColor subColor, int fadeIn, int stay, int fadeOut) Sends a title and subtitle with the given timing to a player.- Parameters:
player
- the player to send the title totitle
- the content of the titletitleColor
- the color of the titlesubtitle
- the content of the subtitlesubColor
- the color of the subtitlefadeIn
- the time in ticks the title should fade in over (default 20)stay
- the time in ticks the title should remain on the screen for between fades (default 60)fadeOut
- the time in ticks the title should fade out over (default 20)
-
sendTitle
public static void sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, int fadeIn, int stay, int fadeOut) Sends a title with the given timing to a player.- Parameters:
player
- the player to send the title totitle
- the content of the titletitleColor
- the color of the titlefadeIn
- the time in ticks the title should fade in over (default 20)stay
- the time in ticks the title should remain on the screen for between fades (default 60)fadeOut
- the time in ticks the title should fade out over (default 20)
-