Class PluginResolver
java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.resolvers.worldname.PluginResolver
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionPluginResolver
(org.bukkit.plugin.Plugin plugin) Constructs aMultiverseV4WorldNameResolver
using the given instance ofMultiverseCore
. -
Method Summary
Modifier and TypeMethodDescriptionresolve
(org.bukkit.World world) Attempts to retrieve the alias name of the specified world usingMultiverse4Retriever
.
-
Constructor Details
-
PluginResolver
public PluginResolver(org.bukkit.plugin.Plugin plugin) Constructs aMultiverseV4WorldNameResolver
using the given instance ofMultiverseCore
.- Parameters:
plugin
- the active Multiverse-Core plugin instance
-
-
Method Details
-
resolve
Attempts to retrieve the alias name of the specified world usingMultiverse4Retriever
. If the alias is null or blank, falls back toworld.getName()
.- Specified by:
resolve
in interfaceWorldNameResolver
- Parameters:
world
- theWorld
whose alias or name should be returned- Returns:
- the Multiverse alias if available, otherwise the world name;
or
"NULL WORLD"
if the world isnull
-