All Known Implementing Classes:
DefaultResolver, PluginResolver

public sealed interface WorldNameResolver permits DefaultResolver, PluginResolver
A runtime-resolvable strategy interface for obtaining a display-friendly name for a World, optionally integrating with external plugins such as Multiverse-Core.

This interface builds upon WorldNameRetriever by providing a static factory method that selects an appropriate implementation based on the server environment at runtime.

When Multiverse-Core is installed and enabled, the returned implementation uses Multiverse APIs to obtain world aliases. Otherwise, a fallback implementation is used that simply returns the default world name from WorldInfo.getName().

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    get(org.bukkit.plugin.PluginManager pluginManager)
    Returns an appropriate WorldNameResolver implementation based on the availability of the Multiverse-Core plugin.
    resolve(org.bukkit.World world)
    Resolves the user-facing name of the given World, using either the native Bukkit name or a plugin-provided alias.
  • Method Details

    • resolve

      String resolve(org.bukkit.World world)
      Resolves the user-facing name of the given World, using either the native Bukkit name or a plugin-provided alias.
      Parameters:
      world - the World whose name should be resolved
      Returns:
      the display or alias name for the world
    • get

      static WorldNameResolver get(org.bukkit.plugin.PluginManager pluginManager)
      Returns an appropriate WorldNameResolver implementation based on the availability of the Multiverse-Core plugin.

      If Multiverse is installed and enabled, this method returns a PluginResolver; otherwise, it falls back to a DefaultResolver.

      Parameters:
      pluginManager - the server's PluginManager
      Returns:
      a WorldNameResolver appropriate for the current server environment