Class EventTitleUtil

java.lang.Object
com.hypixel.hytale.server.core.util.EventTitleUtil

public class EventTitleUtil extends Object
A utility class that contains a variety of useful event title methods.
  • Field Details

    • DEFAULT_ZONE

      public static final String DEFAULT_ZONE
      The default zone name, for an event title.
      See Also:
    • DEFAULT_DURATION

      public static final float DEFAULT_DURATION
      The default duration, in seconds, for an event title.
      See Also:
    • DEFAULT_FADE_DURATION

      public static final float DEFAULT_FADE_DURATION
      The default fade duration, in seconds, for an event title.
      See Also:
  • Constructor Details

    • EventTitleUtil

      public EventTitleUtil()
  • Method Details

    • showEventTitleToUniverse

      @Deprecated(forRemoval=true) public static void showEventTitleToUniverse(@Nonnull Message primaryTitle, @Nullable Message secondaryTitle, boolean isMajor, @Nullable String icon, float duration, float fadeInDuration, float fadeOutDuration)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Show an event title to all worlds in the universe.
      Parameters:
      primaryTitle - The primary title of the event title.
      secondaryTitle - The secondary title of the event title.
      isMajor - Indicates whether the event title is major or minor.
      icon - The icon to display with the event title.
      duration - The duration to display the event title for, in seconds.
      fadeInDuration - The duration of the fade in, in seconds.
      fadeOutDuration - The duration of the fade out, in seconds.
    • showEventTitleToUniverse

      public static void showEventTitleToUniverse(@Nonnull Message primaryTitle, @Nullable Message secondaryTitle, EventTitleStyle style, @Nullable String icon, float duration, float fadeInDuration, float fadeOutDuration)
      Show an event title to all worlds in the universe.
      Parameters:
      primaryTitle - The primary title of the event title.
      secondaryTitle - The secondary title of the event title.
      style - The EventTitleStyle that the client uses to present the event title.
      icon - The icon to display with the event title. null shows no icon.
      duration - The duration to display the event title for, in seconds.
      fadeInDuration - The duration of the fade in, in seconds.
      fadeOutDuration - The duration of the fade out, in seconds.
    • showEventTitleToUniverse

      public static void showEventTitleToUniverse(@Nonnull EventTitleConfig config)
      Show an event title to all worlds in the universe.
      Parameters:
      config - The EventTitleConfig that describes the title.
    • showEventTitleToWorld

      @Deprecated(forRemoval=true) public static void showEventTitleToWorld(@Nonnull Message primaryTitle, @Nonnull Message secondaryTitle, boolean isMajor, String icon, float duration, float fadeInDuration, float fadeOutDuration, @Nonnull World world)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Show an event title to all players in the world.
      Parameters:
      primaryTitle - The primary title of the event title.
      secondaryTitle - The secondary title of the event title.
      isMajor - Indicates whether the event title is major or minor.
      icon - The icon to display with the event title.
      duration - The duration to display the event title for, in seconds.
      fadeInDuration - The duration of the fade in, in seconds.
      fadeOutDuration - The duration of the fade out, in seconds.
      world - The World whose players receive the event title.
    • showEventTitleToWorld

      public static void showEventTitleToWorld(@Nonnull Message primaryTitle, @Nullable Message secondaryTitle, EventTitleStyle style, @Nullable String icon, float duration, float fadeInDuration, float fadeOutDuration, @Nonnull World world)
      Show an event title to all players in the world.
      Parameters:
      primaryTitle - The primary title of the event title.
      secondaryTitle - The secondary title of the event title.
      style - The EventTitleStyle that the client uses to present the event title.
      icon - The icon to display with the event title. null shows no icon.
      duration - The duration to display the event title for, in seconds.
      fadeInDuration - The duration of the fade in, in seconds.
      fadeOutDuration - The duration of the fade out, in seconds.
      world - The World whose players receive the event title.
    • showEventTitleToWorld

      public static void showEventTitleToWorld(@Nonnull EventTitleConfig config, @Nonnull World world)
      Show an event title to all players in the world.
      Parameters:
      config - The EventTitleConfig that describes the title.
      world - The World whose players receive the event title.
    • hideEventTitleFromWorld

      public static void hideEventTitleFromWorld(float fadeOutDuration, @Nonnull World world)
      Hide the event title from all players in the world.
      Parameters:
      fadeOutDuration - The duration of the fade out, in seconds.
      world - The World whose players stop seeing the event title.
    • showEventTitleToPlayer

      @Deprecated(forRemoval=true) public static void showEventTitleToPlayer(@Nonnull PlayerRef playerRefComponent, @Nonnull Message primaryTitle, @Nonnull Message secondaryTitle, boolean isMajor, @Nullable String icon, float duration, float fadeInDuration, float fadeOutDuration)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Show an event title to a specific player.
      Parameters:
      playerRefComponent - The reference to the player entity.
      primaryTitle - The primary title of the event title.
      secondaryTitle - The secondary title of the event title.
      isMajor - Indicates whether the event title is major or minor.
      icon - The icon to display with the event title.
      duration - The duration to display the event title for.
      fadeInDuration - The duration of the fade in, in seconds.
      fadeOutDuration - The duration of the fade out, in seconds.
    • showEventTitleToPlayer

      public static void showEventTitleToPlayer(@Nonnull PlayerRef playerRefComponent, @Nonnull Message primaryTitle, @Nullable Message secondaryTitle, EventTitleStyle style, @Nullable String icon, float duration, float fadeInDuration, float fadeOutDuration)
      Show an event title to a specific player.
      Parameters:
      playerRefComponent - The PlayerRef of the player who receives the event title.
      primaryTitle - The primary title of the event title.
      secondaryTitle - The secondary title of the event title.
      style - The EventTitleStyle that the client uses to present the event title.
      icon - The icon to display with the event title. null shows no icon.
      duration - The duration to display the event title for, in seconds.
      fadeInDuration - The duration of the fade in, in seconds.
      fadeOutDuration - The duration of the fade out, in seconds.
    • showEventTitleToPlayer

      public static void showEventTitleToPlayer(@Nonnull PlayerRef playerRefComponent, @Nonnull EventTitleConfig config)
      Show an event title to a specific player.
      Parameters:
      playerRefComponent - The PlayerRef of the player who receives the event title.
      config - The EventTitleConfig that describes the title.
    • showEventTitleToPlayer

      @Deprecated(forRemoval=true) public static void showEventTitleToPlayer(@Nonnull PlayerRef playerRefComponent, @Nonnull Message primaryTitle, @Nonnull Message secondaryTitle, boolean isMajor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Show an event title to a specific player with default duration and fade durations.
      Parameters:
      playerRefComponent - The reference to the player entity.
      primaryTitle - The primary title of the event title.
      secondaryTitle - The secondary title of the event title.
      isMajor - Indicates whether the event title is major or minor.
    • showEventTitleToPlayer

      public static void showEventTitleToPlayer(@Nonnull PlayerRef playerRefComponent, @Nonnull Message primaryTitle, @Nonnull Message secondaryTitle, EventTitleStyle style)
      Show an event title to a specific player with default duration and fade durations. The title uses DEFAULT_DURATION and DEFAULT_FADE_DURATION. The title has no icon.
      Parameters:
      playerRefComponent - The PlayerRef of the player who receives the event title.
      primaryTitle - The primary title of the event title.
      secondaryTitle - The secondary title of the event title.
      style - The EventTitleStyle that the client uses to present the event title.
    • hideEventTitleFromPlayer

      public static void hideEventTitleFromPlayer(@Nonnull PlayerRef playerRefComponent, float fadeOutDuration)
      Hide the event title from a specific player.
      Parameters:
      playerRefComponent - The reference to the player entity.
      fadeOutDuration - The duration of the fade out, in seconds.
    • getDefaultFadeInDuration

      public static float getDefaultFadeInDuration(EventTitleStyle style)
      Gets the default fade-in duration for an event title style.
      Parameters:
      style - The EventTitleStyle to get the default fade-in duration for.
      Returns:
      The default fade-in duration, in seconds.