Package com.winterhavenmc.library.messagebuilder.adapters.pipeline.accessors.name
package com.winterhavenmc.library.messagebuilder.adapters.pipeline.accessors.name
Provides the
Nameable interface and its corresponding adapter used to extract and format
name-related fields from objects passed into the message pipeline.
Objects that implement Nameable
expose a getName() method used for macro substitution in message templates. The adapter in this package
maps such values to a dot-notated macro string (e.g., {OBJECT.NAME}) that is automatically replaced during
message composition.
Plugin Integration
Plugin developers can opt into this system by having their own domain types implement the Nameable interface.
For example, a plugin-defined class:
public class CustomNPC implements Nameable {
@Override
public Section getName() {
return this.name;
}
}
When a CustomNPC instance is passed into the macro context (via setMacro()),
the message builder will automatically resolve the placeholder {CUSTOMNPC.NAME}.
Standard Support
This adapter also supports built-in Bukkit types such as:
CommandSenderOfflinePlayerPlayerProfileWorldServerPlugin
- See Also:
-
ClassesClassDescriptionAn
Accessorfor extracting name information from objects that expose agetName()method.