Interface AfkModule

All Superinterfaces:
ModuleLocalization, ModuleSimple

public interface AfkModule extends ModuleLocalization
Marks players away automatically once they stop moving, and announces when they come back.
  • Method Details

    • config

      Message.Afk config()
      Description copied from interface: ModuleSimple
      The config section this module reads its settings from.
      Specified by:
      config in interface ModuleSimple
      Returns:
      the settings
    • permission

      Description copied from interface: ModuleSimple
      The permission that gates this module.
      Specified by:
      permission in interface ModuleSimple
      Returns:
      the permission
    • localization

      Localization.Message.Afk localization(FPlayer fPlayer)
      Description copied from interface: ModuleLocalization
      The localization section for a player, picked from their chosen language.
      Specified by:
      localization in interface ModuleLocalization
      Parameters:
      fPlayer - the player the text is for
      Returns:
      the localization settings
    • addTag

      MessageContext addTag(MessageContext messageContext)
      Registers the tag that renders a player's away marker.
      Parameters:
      messageContext - the message being formatted
      Returns:
      the context with the tag added
    • removeAllAfkPlayers

      void removeAllAfkPlayers(String action)
      Brings everyone back from afk, used on reload and shutdown.
      Parameters:
      action - what caused it, for the announcement
    • removeAfk

      void removeAfk(@NonNull String action, @NonNull FPlayer fPlayer)
      Brings one player back from afk and announces it.
      Parameters:
      action - what caused it
      fPlayer - the player
    • addAfk

      void addAfk(FPlayer fPlayer)
      Marks a player away and announces it.
      Parameters:
      fPlayer - the player
    • getAfkDuration

      int getAfkDuration(FPlayer fPlayer)
      How long a player has been away.
      Parameters:
      fPlayer - the player
      Returns:
      the duration in milliseconds, or 0 if they are not away
    • getAfkDurationFormatted

      @NonNull String getAfkDurationFormatted(FPlayer fPlayer, FPlayer fReceiver)
    • localizationFormat

      String localizationFormat(FEntity fPlayer, FPlayer fResolver, boolean isAfk)
      The marker appended to an away player's name.
      Parameters:
      fPlayer - the away player
      fResolver - the reader
      isAfk - whether the player is away
      Returns:
      the marker, or an empty string