Interface WorldNameResolver
- All Known Implementing Classes:
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 TypeMethodDescriptionstatic WorldNameResolver
get
(org.bukkit.plugin.PluginManager pluginManager) Returns an appropriateWorldNameResolver
implementation based on the availability of theMultiverse-Core
plugin.resolve
(org.bukkit.World world) Resolves the user-facing name of the givenWorld
, using either the native Bukkit name or a plugin-provided alias.
-
Method Details
-
resolve
Resolves the user-facing name of the givenWorld
, using either the native Bukkit name or a plugin-provided alias.- Parameters:
world
- theWorld
whose name should be resolved- Returns:
- the display or alias name for the world
-
get
Returns an appropriateWorldNameResolver
implementation based on the availability of theMultiverse-Core
plugin.If Multiverse is installed and enabled, this method returns a
PluginResolver
; otherwise, it falls back to aDefaultResolver
.- Parameters:
pluginManager
- the server'sPluginManager
- Returns:
- a
WorldNameResolver
appropriate for the current server environment
-