java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.adapters.looter.LooterAdapter
All Implemented Interfaces:
Adapter

public class LooterAdapter extends Object implements Adapter
Adapter that converts supported objects into the Lootable interface for macro resolution.

This adapter is designed to identify the entity who is entitled to loot a container or object, not necessarily one who has already looted it. It is useful for generating access-related messages such as "Only {OBJECT.LOOTER} may open this chest."

Supports:

  • Objects explicitly implementing Lootable
  • LootContext via its getKiller() method
  • Constructor Details

    • LooterAdapter

      public LooterAdapter()
  • Method Details

    • adapt

      public Optional<Lootable> adapt(Object obj)
      Attempts to adapt an object into a Lootable.
      Specified by:
      adapt in interface Adapter
      Parameters:
      obj - the object to adapt
      Returns:
      an Optional<Lootable> if supported, or empty otherwise