Interface ConditionModule

All Superinterfaces:
ModuleLocalization, ModuleSimple

public interface ConditionModule extends ModuleLocalization
Picks between alternative texts based on a condition, such as a permission or a placeholder value.
  • Method Details

    • localization

      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
    • 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
    • addTag

      MessageContext addTag(MessageContext messageContext)
      Registers the tag that picks between alternative texts.
      Parameters:
      messageContext - the message being formatted
      Returns:
      the context with the tag added
    • getConditionValue

      @Nullable String getConditionValue(String conditionName, FPlayer fPlayer)
      The value a condition currently has for a player.
      Parameters:
      conditionName - the condition
      fPlayer - the player
      Returns:
      the value, or an empty string if the condition is unknown
    • 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 condition
      fPlayer - who wrote the message
      fReceiver - who reads it
      flags - the formatting switches
      Returns:
      the value, or an empty string if the condition is unknown
    • replaceCondition

      @Nullable String replaceCondition(String message, FPlayer fPlayer)
      Parses condition tag in a raw string
      Parameters:
      message - the raw text
      fPlayer - whose conditions are read
      Returns:
      the text with condition
    • 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 text
      fPlayer - who wrote the message
      fReceiver - who reads it
      flags - the formatting switches
      Returns:
      the text with condition