public abstract class FriendlyComponentRenderer<C> extends java.lang.Object implements ComponentRenderer<C>
| Constructor and Description |
|---|
FriendlyComponentRenderer() |
| Modifier and Type | Method and Description |
|---|---|
static <C> @NonNull FriendlyComponentRenderer<C> |
from(@NonNull java.util.function.BiFunction<C,java.lang.String,java.text.MessageFormat> translations) |
@NonNull Component |
render(@NonNull Component component,
C context)
Renders a component.
|
protected abstract @Nullable java.text.MessageFormat |
translation(C context,
@NonNull java.lang.String key)
Gets a translation for a translation key in the given context.
|
public static <C> @NonNull FriendlyComponentRenderer<C> from(@NonNull java.util.function.BiFunction<C,java.lang.String,java.text.MessageFormat> translations)
public @NonNull Component render(@NonNull Component component, C context)
ComponentRendererrender in interface ComponentRenderer<C>component - the componentcontext - the contextprotected abstract @Nullable java.text.MessageFormat translation(C context, @NonNull java.lang.String key)
context - the contextkey - the translation key