Package com.winterhavenmc.library.messagebuilder.pipeline.adapters.displayname
package com.winterhavenmc.library.messagebuilder.pipeline.adapters.displayname
Provides an adapter and interface for extracting and formatting display names from objects.
Any object that implements the DisplayNameable
interface can participate in macro replacement via the {OBJECT.DISPLAY_NAME}
placeholder in language file strings.
This package includes:
DisplayNameable
— a functional interface describing objects that expose agetDisplayName()
method.DisplayNameAdapter
— anAdapter
implementation that adapts various types to theDisplayNameable
contract.
The DisplayNameAdapter
supports:
- Objects already implementing
DisplayNameable
Player
— usesPlayer.getDisplayName()
Nameable
— usesNameable.getCustomName()
Note: this references the Bukkit Nameable interface, and not the Nameable interface of the corresponding adapter found in this library.World
— resolves the display name via aWorldNameResolver
The macro value is only populated if the display name is non-null and non-blank.
- See Also:
-
ClassDescriptionAn interface representing objects that expose a display name for macro replacement.Adapter implementation for extracting display names from supported object types.