Package com.winterhavenmc.library.messagebuilder.adapters.pipeline.accessors.displayname
package com.winterhavenmc.library.messagebuilder.adapters.pipeline.accessors.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— anAccessorimplementation that adapts various types to theDisplayNameablecontract.
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:
-
ClassesClassDescriptionAccessor implementation for extracting display names from supported object types.