Package me.croabeast.takion.format
Interface ContextualFormat<T>
- Type Parameters:
T- the type of the result produced when this format is applied
- All Superinterfaces:
Format<T>
Extends
Format to support transformations that depend on a collection of players
rather than a single player or none.
ContextualFormat introduces the core method accept(Collection, String) which
receives the full player context for formats that need to broadcast or aggregate across
multiple players at once.
-
Method Summary
Modifier and TypeMethodDescriptionaccept(Collection<? extends org.bukkit.entity.Player> players, String string) Transform the given text using this format in the context of multiple players.default TConvenience overload for a single player context.Methods inherited from interface me.croabeast.takion.format.Format
accept, getRegex, isFormatted, matcher, removeFormat, toFormattedString
-
Method Details
-
accept
Transform the given text using this format in the context of multiple players.Implementations must override this method to perform the desired logic based on the raw input string and the full player collection.
- Parameters:
players- the player contexts (may benullor empty)string- the text to transform (nevernull)- Returns:
- the result of applying this format across the given players
-
accept
Convenience overload for a single player context.Delegates to
accept(Collection, String)by wrapping the givenPlayerinto a singleton collection. Override only if single-player handling must differ.
-