Class ConfiguredLocaleResolver

java.lang.Object
com.ultikits.ultitools.text.internal.ConfiguredLocaleResolver
All Implemented Interfaces:
LocaleResolver

@Internal public final class ConfiguredLocaleResolver extends Object implements LocaleResolver
Resolves current configuration strings without caching player preferences.
  • Field Details

  • Constructor Details

  • Method Details

    • reload

      public void reload()
      Re-evaluates the fallback once after a successful framework configuration reload.
    • forConfig

      public static ConfiguredLocaleResolver forConfig(Supplier<? extends org.bukkit.configuration.ConfigurationSection> configuration, Logger logger)
      Reads operator values without inheriting the newly shipped defaults for an existing configuration. This method never saves or otherwise changes the operator's configuration file.
      Parameters:
      configuration - the current configuration, replaced by Bukkit on reload
      logger - the framework logger
      Returns:
      a resolver over explicit configuration values
    • forConfig

      static ConfiguredLocaleResolver forConfig(Supplier<? extends org.bukkit.configuration.ConfigurationSection> configuration, Logger logger, Supplier<ZoneId> timeZone)
    • automaticZone

      Optional<ZoneId> automaticZone()
    • resolve

      public Locale resolve(net.kyori.adventure.audience.Audience audience)
      Description copied from interface: LocaleResolver
      Returns the recipient's preferred locale, without checking catalogue availability.
      Specified by:
      resolve in interface LocaleResolver
    • fallback

      public Locale fallback()
      Description copied from interface: LocaleResolver
      Returns the operator's fallback language, also used for console output.
      Specified by:
      fallback in interface LocaleResolver
    • forced

      public Optional<Locale> forced()
      Description copied from interface: LocaleResolver
      Returns the forced language, or empty in auto mode.
      Specified by:
      forced in interface LocaleResolver
    • snapshot

    • configuredLanguage

      private Optional<Locale> configuredLanguage(@Nullable @Nullable String raw)
    • selectFallback

      private ConfiguredLocaleResolver.Fallback selectFallback(@Nullable @Nullable String raw, Optional<Locale> forced)
    • warn

      private void warn(String key, String value)