Class LocationAdapter
java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.adapters.location.LocationAdapter
- All Implemented Interfaces:
Adapter
Adapter for objects that expose a
Location
, either directly or via a Locatable
interface.
This adapter provides macro key 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 theLocatable
interfaceEntity
OfflinePlayer
Chest
andDoubleChest
Block
andBlockState
Inventory
Raid
LootContext
Location
itself
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.pipeline.adapters.Adapter
Adapter.BuiltIn
-
Field Summary
Fields inherited from interface com.winterhavenmc.library.messagebuilder.pipeline.adapters.Adapter
UNKNOWN_VALUE
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LocationAdapter
public LocationAdapter()
-
-
Method Details
-
adapt
Description copied from interface:Adapter
Attempts 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 emptyOptional
is returned.
-