Class JoinTitleManager

java.lang.Object
me.remigio07.chatplugin.api.server.join_quit.JoinTitleManager
All Implemented Interfaces:
ChatPluginManager

public abstract class JoinTitleManager extends Object implements ChatPluginManager
Manager that handles join titles.
See Also:
  • Constructor Details

    • JoinTitleManager

      public JoinTitleManager()
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Checks if this manager is enabled.

      Found at: "join-quit-modules.join-titles.settings.enabled" in ConfigurationType.JOIN_QUIT_MODULES

      Specified by:
      isEnabled in interface ChatPluginManager
      Returns:
      Whether this manager is enabled
    • getFadeIn

      public long getFadeIn()
      Gets the time for the join title to fade in, in milliseconds.

      Found at: "join-quit-modules.join-titles.settings.fade-in-ms" in ConfigurationType.JOIN_QUIT_MODULES

      Returns:
      Time to fade in
    • getStay

      public long getStay()
      Gets the time for the join title to stay, in milliseconds.

      Found at: "join-quit-modules.join-titles.settings.stay-ms" in ConfigurationType.JOIN_QUIT_MODULES

      Returns:
      Time to stay
    • getFadeOut

      public long getFadeOut()
      Gets the time for the join title to fade out, in milliseconds.

      Found at: "join-quit-modules.join-titles.settings.fade-out-ms" in ConfigurationType.JOIN_QUIT_MODULES

      Returns:
      Time to fade out
    • getDelay

      public long getDelay()
      Gets the delay to wait before sending the join title, in milliseconds.

      Found at: "join-quit-modules.join-titles.settings.delay-ms" in ConfigurationType.JOIN_QUIT_MODULES

      Returns:
      Delay to wait
    • getPlaceholderTypes

      public List<PlaceholderType> getPlaceholderTypes()
      Gets the list of placeholder types used to translate getTitles() and getSubtitles().

      Found at: "join-quit-modules.join-titles.settings.placeholder-types" in ConfigurationType.JOIN_QUIT_MODULES

      Returns:
      Placeholders used to translate join titles
    • getTitles

      public Map<Language,String> getTitles()
      Gets the map of loaded titles.

      You may modify the returned map, but it cannot point to a null value for Language.getMainLanguage().

      Found at: "join-quit-modules.join-titles.titles" in ConfigurationType.JOIN_QUIT_MODULES

      Returns:
      Loaded titles' map
    • getTitle

      public String getTitle(Language language, boolean avoidNull)
      Gets the title for the specified language.

      Specify true as avoidNull to fall back to Language.getMainLanguage()'s title if no title is present for the specified language. Will return null if getTitles().get(language) == null && !avoidNull.

      Parameters:
      language - Language used to translate the title
      avoidNull - Whether to avoid returning null
      Returns:
      Loaded title
    • getSubtitles

      public Map<Language,String> getSubtitles()
      Gets the map of loaded subtitles.

      You may modify the returned map, but it cannot point to a null value for Language.getMainLanguage().

      Found at: "join-quit-modules.join-titles.subtitles" in ConfigurationType.JOIN_QUIT_MODULES

      Returns:
      Loaded subtitles' map
    • getSubtitle

      public String getSubtitle(Language language, boolean avoidNull)
      Gets the subtitle for the specified language.

      Specify true as avoidNull to fall back to Language.getMainLanguage()'s subtitle if no subtitle is present for the specified language. Will return null if getSubtitles().get(language) == null && !avoidNull.

      Parameters:
      language - Language used to translate the subtitle
      avoidNull - Whether to avoid returning null
      Returns:
      Loaded subtitle
    • getInstance

      public static JoinTitleManager getInstance()
      Gets this manager's instance.
      Returns:
      Manager's instance
    • sendJoinTitle

      public abstract void sendJoinTitle(ChatPluginServerPlayer player, boolean applyDelay)
      Sends the join title to the specified player.
      Parameters:
      player - Player to send the join title to
      applyDelay - Whether to wait getDelay()