Interface ConditionModule
- All Superinterfaces:
ModuleLocalization, ModuleSimple
Picks between alternative texts based on a condition, such as a permission or a placeholder value.
-
Method Summary
Modifier and TypeMethodDescriptionaddTag(MessageContext messageContext) Registers the tag that picks between alternative texts.config()The config section this module reads its settings from.@Nullable StringgetConditionValue(String conditionName, FEntity fPlayer, FPlayer fReceiver, Map<MessageFlag, Boolean> flags) The value a condition has for a sender and reader pair, with the message flags in scope.@Nullable StringgetConditionValue(String conditionName, FPlayer fPlayer) The value a condition currently has for a player.localization(FPlayer fPlayer) The localization section for a player, picked from their chosen language.The permission that gates this module.@Nullable StringreplaceCondition(String message, FEntity fPlayer, FPlayer fReceiver, Map<MessageFlag, Boolean> flags) Parses condition tag in a raw string@Nullable StringreplaceCondition(String message, FPlayer fPlayer) Parses condition tag in a raw stringMethods inherited from interface ModuleLocalization
cooldown, cooldownOrThrow, permissions, sound, soundOrThrow
-
Method Details
-
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
-
config
Message.Format.Condition config()Description copied from interface:ModuleSimpleThe config section this module reads its settings from.- Specified by:
configin interfaceModuleSimple- Returns:
- the settings
-
permission
Permission.Message.Format.Condition permission()Description copied from interface:ModuleSimpleThe permission that gates this module.- Specified by:
permissionin interfaceModuleSimple- Returns:
- the permission
-
addTag
Registers the tag that picks between alternative texts.- Parameters:
messageContext- the message being formatted- Returns:
- the context with the tag added
-
getConditionValue
-
getConditionValue
@Nullable String getConditionValue(String conditionName, FEntity fPlayer, FPlayer fReceiver, Map<MessageFlag, Boolean> flags) The value a condition has for a sender and reader pair, with the message flags in scope.- Parameters:
conditionName- the conditionfPlayer- who wrote the messagefReceiver- who reads itflags- the formatting switches- Returns:
- the value, or an empty string if the condition is unknown
-
replaceCondition
-
replaceCondition
@Nullable String replaceCondition(String message, FEntity fPlayer, FPlayer fReceiver, Map<MessageFlag, Boolean> flags) Parses condition tag in a raw string- Parameters:
message- the raw textfPlayer- who wrote the messagefReceiver- who reads itflags- the formatting switches- Returns:
- the text with condition
-