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 a getDisplayName() method.
  • DisplayNameAdapter — an Adapter implementation that adapts various types to the DisplayNameable contract.

The DisplayNameAdapter supports:

  • Objects already implementing DisplayNameable
  • Player — uses Player.getDisplayName()
  • Nameable — uses Nameable.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 a WorldNameResolver

The macro value is only populated if the display name is non-null and non-blank.

See Also: