public abstract class TranslatableComponentRenderer<C> extends AbstractComponentRenderer<C>
MessageFormat-based translatable component renderer.| Constructor and Description |
|---|
TranslatableComponentRenderer() |
| Modifier and Type | Method and Description |
|---|---|
static <C> @NonNull TranslatableComponentRenderer<C> |
from(@NonNull java.util.function.BiFunction<C,java.lang.String,java.text.MessageFormat> translations) |
protected @NonNull Component |
renderBlockNbt(@NonNull BlockNbtComponent component,
C context) |
protected @NonNull Component |
renderEntityNbt(@NonNull EntityNbtComponent component,
C context) |
protected @NonNull Component |
renderKeybind(@NonNull KeybindComponent component,
C context) |
protected @NonNull Component |
renderScore(@NonNull ScoreComponent component,
C context) |
protected @NonNull Component |
renderSelector(@NonNull SelectorComponent component,
C context) |
protected @NonNull Component |
renderStorageNbt(@NonNull StorageNbtComponent component,
C context) |
protected @NonNull Component |
renderText(@NonNull TextComponent component,
C context) |
protected @NonNull Component |
renderTranslatable(@NonNull TranslatableComponent component,
C context) |
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.
|
renderpublic static <C> @NonNull TranslatableComponentRenderer<C> from(@NonNull java.util.function.BiFunction<C,java.lang.String,java.text.MessageFormat> translations)
protected @NonNull Component renderBlockNbt(@NonNull BlockNbtComponent component, C context)
renderBlockNbt in class AbstractComponentRenderer<C>protected @NonNull Component renderEntityNbt(@NonNull EntityNbtComponent component, C context)
renderEntityNbt in class AbstractComponentRenderer<C>protected @NonNull Component renderStorageNbt(@NonNull StorageNbtComponent component, C context)
renderStorageNbt in class AbstractComponentRenderer<C>protected @NonNull Component renderKeybind(@NonNull KeybindComponent component, C context)
renderKeybind in class AbstractComponentRenderer<C>protected @NonNull Component renderScore(@NonNull ScoreComponent component, C context)
renderScore in class AbstractComponentRenderer<C>protected @NonNull Component renderSelector(@NonNull SelectorComponent component, C context)
renderSelector in class AbstractComponentRenderer<C>protected @NonNull Component renderText(@NonNull TextComponent component, C context)
renderText in class AbstractComponentRenderer<C>protected @NonNull Component renderTranslatable(@NonNull TranslatableComponent component, C context)
renderTranslatable in class AbstractComponentRenderer<C>protected abstract @Nullable java.text.MessageFormat translation(C context, @NonNull java.lang.String key)
context - the contextkey - the translation key