java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.resolvers.worldname.PluginResolver
All Implemented Interfaces:
WorldNameResolver

public final class PluginResolver extends Object implements WorldNameResolver
A WorldNameResolver implementation that retrieves world name aliases using the Multiverse-Core plugin.

If an alias is found for the given World, it is returned as the display name. If no alias is available (e.g., null or blank), the resolver falls back to the default world name from WorldInfo.getName().

If the input world is null, this resolver returns the string "NULL WORLD".

This class is only instantiated when Multiverse-Core is detected and enabled at runtime. Use WorldNameResolver.get(PluginManager) to safely select the appropriate implementation.

See Also:
  • Constructor Details

    • PluginResolver

      public PluginResolver(org.bukkit.plugin.Plugin plugin)
      Constructs a MultiverseV4WorldNameResolver using the given instance of MultiverseCore.
      Parameters:
      plugin - the active Multiverse-Core plugin instance
  • Method Details

    • resolve

      public String resolve(org.bukkit.World world)
      Attempts to retrieve the alias name of the specified world using Multiverse4Retriever. If the alias is null or blank, falls back to world.getName().
      Specified by:
      resolve in interface WorldNameResolver
      Parameters:
      world - the World whose alias or name should be returned
      Returns:
      the Multiverse alias if available, otherwise the world name; or "NULL WORLD" if the world is null