Class TranslatableComponentRenderer<C>
- java.lang.Object
- 
- net.kyori.adventure.text.renderer.AbstractComponentRenderer<C>
- 
- net.kyori.adventure.text.renderer.TranslatableComponentRenderer<C>
 
 
- 
- Type Parameters:
- C- the context type, usually- Locale.
 - All Implemented Interfaces:
- ComponentRenderer<C>
 
 public abstract class TranslatableComponentRenderer<C> extends AbstractComponentRenderer<C> A component renderer that does server-side translation rendering.- Since:
- 4.0.0
 
- 
- 
Constructor SummaryConstructors Constructor Description TranslatableComponentRenderer()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected <B extends ComponentBuilder<?,?>>
 voidmergeStyle(Component component, B builder, C context)protected <O extends BuildableComponent<O,B>,B extends ComponentBuilder<O,B>>
 OmergeStyleAndOptionallyDeepRender(Component component, B builder, C context)protected <O extends NBTComponent<O,B>,B extends NBTComponentBuilder<O,B>>
 Bnbt(C context, B builder, O oldComponent)protected <O extends BuildableComponent<O,B>,B extends ComponentBuilder<O,B>>
 OoptionallyRenderChildrenAppendAndBuild(java.util.List<Component> children, B builder, C context)protected @NotNull ComponentrenderBlockNbt(@NotNull BlockNBTComponent component, C context)Renders a block NBT component.protected @NotNull ComponentrenderEntityNbt(@NotNull EntityNBTComponent component, C context)Renders an entity NBT component.protected @NotNull ComponentrenderKeybind(@NotNull KeybindComponent component, C context)Renders a keybind component.protected @NotNull ComponentrenderScore(@NotNull ScoreComponent component, C context)Renders a score component.protected @NotNull ComponentrenderSelector(@NotNull SelectorComponent component, C context)Renders a selector component.protected @NotNull ComponentrenderStorageNbt(@NotNull StorageNBTComponent component, C context)Renders a storage NBT component.protected @NotNull ComponentrenderText(@NotNull TextComponent component, C context)Renders a text component.protected @NotNull ComponentrenderTranslatable(@NotNull TranslatableComponent component, C context)Renders a translatable component.protected abstract @Nullable java.text.MessageFormattranslate(@NotNull java.lang.String key, C context)Gets a message format from a key and context.static @NotNull TranslatableComponentRenderer<java.util.Locale>usingTranslationSource(@NotNull Translator source)Creates aTranslatableComponentRendererusing theTranslatorto translate.- 
Methods inherited from class net.kyori.adventure.text.renderer.AbstractComponentRendererrender
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface net.kyori.adventure.text.renderer.ComponentRenderermapContext
 
- 
 
- 
- 
- 
Method Detail- 
usingTranslationSource@NotNull public static @NotNull TranslatableComponentRenderer<java.util.Locale> usingTranslationSource(@NotNull @NotNull Translator source) Creates aTranslatableComponentRendererusing theTranslatorto translate.Alongside the standard MessageFormat-based translation, this will also allow theTranslatorto create aComponentdirectly.- Parameters:
- source- the translation source
- Returns:
- the renderer
- Since:
- 4.0.0
 
 - 
translate@Nullable protected abstract @Nullable java.text.MessageFormat translate(@NotNull @NotNull java.lang.String key, @NotNull C context)Gets a message format from a key and context.- Parameters:
- key- a translation key
- context- a context
- Returns:
- a message format or nullto skip translation
 
 - 
renderBlockNbt@NotNull protected @NotNull Component renderBlockNbt(@NotNull @NotNull BlockNBTComponent component, @NotNull C context) Description copied from class:AbstractComponentRendererRenders a block NBT component.- Specified by:
- renderBlockNbtin class- AbstractComponentRenderer<C>
- Parameters:
- component- the component
- context- the context
- Returns:
- the rendered component
 
 - 
renderEntityNbt@NotNull protected @NotNull Component renderEntityNbt(@NotNull @NotNull EntityNBTComponent component, @NotNull C context) Description copied from class:AbstractComponentRendererRenders an entity NBT component.- Specified by:
- renderEntityNbtin class- AbstractComponentRenderer<C>
- Parameters:
- component- the component
- context- the context
- Returns:
- the rendered component
 
 - 
renderStorageNbt@NotNull protected @NotNull Component renderStorageNbt(@NotNull @NotNull StorageNBTComponent component, @NotNull C context) Description copied from class:AbstractComponentRendererRenders a storage NBT component.- Specified by:
- renderStorageNbtin class- AbstractComponentRenderer<C>
- Parameters:
- component- the component
- context- the context
- Returns:
- the rendered component
 
 - 
nbtprotected <O extends NBTComponent<O,B>,B extends NBTComponentBuilder<O,B>> B nbt(@NotNull C context, B builder, O oldComponent) 
 - 
renderKeybind@NotNull protected @NotNull Component renderKeybind(@NotNull @NotNull KeybindComponent component, @NotNull C context) Description copied from class:AbstractComponentRendererRenders a keybind component.- Specified by:
- renderKeybindin class- AbstractComponentRenderer<C>
- Parameters:
- component- the component
- context- the context
- Returns:
- the rendered component
 
 - 
renderScore@NotNull protected @NotNull Component renderScore(@NotNull @NotNull ScoreComponent component, @NotNull C context) Description copied from class:AbstractComponentRendererRenders a score component.- Specified by:
- renderScorein class- AbstractComponentRenderer<C>
- Parameters:
- component- the component
- context- the context
- Returns:
- the rendered component
 
 - 
renderSelector@NotNull protected @NotNull Component renderSelector(@NotNull @NotNull SelectorComponent component, @NotNull C context) Description copied from class:AbstractComponentRendererRenders a selector component.- Specified by:
- renderSelectorin class- AbstractComponentRenderer<C>
- Parameters:
- component- the component
- context- the context
- Returns:
- the rendered component
 
 - 
renderText@NotNull protected @NotNull Component renderText(@NotNull @NotNull TextComponent component, @NotNull C context) Description copied from class:AbstractComponentRendererRenders a text component.- Specified by:
- renderTextin class- AbstractComponentRenderer<C>
- Parameters:
- component- the component
- context- the context
- Returns:
- the rendered component
 
 - 
renderTranslatable@NotNull protected @NotNull Component renderTranslatable(@NotNull @NotNull TranslatableComponent component, @NotNull C context) Description copied from class:AbstractComponentRendererRenders a translatable component.- Specified by:
- renderTranslatablein class- AbstractComponentRenderer<C>
- Parameters:
- component- the component
- context- the context
- Returns:
- the rendered component
 
 - 
mergeStyleAndOptionallyDeepRenderprotected <O extends BuildableComponent<O,B>,B extends ComponentBuilder<O,B>> O mergeStyleAndOptionallyDeepRender(Component component, B builder, C context) 
 - 
optionallyRenderChildrenAppendAndBuildprotected <O extends BuildableComponent<O,B>,B extends ComponentBuilder<O,B>> O optionallyRenderChildrenAppendAndBuild(java.util.List<Component> children, B builder, C context) 
 - 
mergeStyleprotected <B extends ComponentBuilder<?,?>> void mergeStyle(Component component, B builder, C context) 
 
- 
 
-