Interface AfkModule
- All Superinterfaces:
ModuleLocalization, ModuleSimple
Marks players away automatically once they stop moving, and announces when they come back.
-
Method Summary
Modifier and TypeMethodDescriptionvoidMarks a player away and announces it.addTag(MessageContext messageContext) Registers the tag that renders a player's away marker.config()The config section this module reads its settings from.intgetAfkDuration(FPlayer fPlayer) How long a player has been away.@NonNull StringgetAfkDurationFormatted(FPlayer fPlayer, FPlayer fReceiver) localization(FPlayer fPlayer) The localization section for a player, picked from their chosen language.localizationFormat(FEntity fPlayer, FPlayer fResolver, boolean isAfk) The marker appended to an away player's name.The permission that gates this module.voidBrings one player back from afk and announces it.voidremoveAllAfkPlayers(String action) Brings everyone back from afk, used on reload and shutdown.Methods inherited from interface ModuleLocalization
cooldown, cooldownOrThrow, permissions, sound, soundOrThrow
-
Method Details
-
config
Message.Afk config()Description copied from interface:ModuleSimpleThe config section this module reads its settings from.- Specified by:
configin interfaceModuleSimple- Returns:
- the settings
-
permission
Permission.Message.Afk permission()Description copied from interface:ModuleSimpleThe permission that gates this module.- Specified by:
permissionin interfaceModuleSimple- Returns:
- the permission
-
localization
Description copied from interface:ModuleLocalizationThe localization section for a player, picked from their chosen language.- Specified by:
localizationin interfaceModuleLocalization- Parameters:
fPlayer- the player the text is for- Returns:
- the localization settings
-
addTag
Registers the tag that renders a player's away marker.- Parameters:
messageContext- the message being formatted- Returns:
- the context with the tag added
-
removeAllAfkPlayers
Brings everyone back from afk, used on reload and shutdown.- Parameters:
action- what caused it, for the announcement
-
removeAfk
-
addAfk
-
getAfkDuration
How long a player has been away.- Parameters:
fPlayer- the player- Returns:
- the duration in milliseconds, or 0 if they are not away
-
getAfkDurationFormatted
-
localizationFormat
-