Class LocationAdapter
java.lang.Object
com.winterhavenmc.library.messagebuilder.adapters.pipeline.accessors.location.LocationAdapter
- All Implemented Interfaces:
Accessor
Accessor for objects that expose a
Location, either directly or via a Locatable interface.
This adapter provides macro string support for structured location data, including:
[OBJECT.LOCATION} – the full location string, including world and coordinates[OBJECT.LOCATION.WORLD},[OBJECT.LOCATION.X},Y,Z– individual components
The world name is resolved using the
WorldNameResolver
if Multiverse is installed and enabled, allowing server-defined aliases to appear in resolved messages.
This adapter supports the following object types:
Locatable– objects implementing theLocatableinterfaceEntityOfflinePlayerChestandDoubleChestBlockandBlockStateInventoryRaidLootContextLocationitself
Each type is adapted to a Locatable using a method reference that returns the underlying Location.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.winterhavenmc.library.messagebuilder.core.ports.pipeline.accessors.Accessor
Accessor.BuiltIn -
Field Summary
Fields inherited from interface com.winterhavenmc.library.messagebuilder.core.ports.pipeline.accessors.Accessor
UNKNOWN_VALUE -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LocationAdapter
public LocationAdapter()
-
-
Method Details
-
adapt
Description copied from interface:AccessorAttempts to adapt the given object to a type-specific representation for macro extraction.This method may return a known interface (e.g.,
Nameable) or a domain object suitable for field extraction by a resolver. If the object is not compatible, an emptyOptionalis returned.
-