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 SummaryModifier 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 static <C extends NBTComponent<C, B>, B extends NBTComponentBuilder<C, B>>
 Bnbt(B builder, C oldComponent)protected <O extends BuildableComponent<O, B>, B extends ComponentBuilder<O, B>>
 OoptionallyRenderChildrenAppendAndBuild(List<Component> children, B builder, C context)protected @NonNull ComponentrenderBlockNbt(@NonNull BlockNBTComponent component, @NonNull C context)Renders a block NBT component.protected @NonNull ComponentrenderEntityNbt(@NonNull EntityNBTComponent component, @NonNull C context)Renders an entity NBT component.protected @NonNull ComponentrenderKeybind(@NonNull KeybindComponent component, @NonNull C context)Renders a keybind component.protected @NonNull ComponentrenderScore(@NonNull ScoreComponent component, @NonNull C context)Renders a score component.protected @NonNull ComponentrenderSelector(@NonNull SelectorComponent component, @NonNull C context)Renders a selector component.protected @NonNull ComponentrenderStorageNbt(@NonNull StorageNBTComponent component, @NonNull C context)Renders a storage NBT component.protected @NonNull ComponentrenderText(@NonNull TextComponent component, @NonNull C context)Renders a text component.protected @NonNull ComponentrenderTranslatable(@NonNull TranslatableComponent component, @NonNull C context)Renders a translatable component.protected abstract @Nullable MessageFormattranslate(@NonNull String key, @NonNull C context)Gets a message format from a key and context.static @NonNull TranslatableComponentRenderer<Locale>usingTranslationSource(@NonNull Translator source)Creates aTranslatableComponentRendererusing theTranslatorto translate.
- 
Constructor Details- 
TranslatableComponentRendererpublic TranslatableComponentRenderer()
 
- 
- 
Method Details- 
usingTranslationSourcepublic static @NonNull TranslatableComponentRenderer<Locale> usingTranslationSource(@NonNull Translator source)Creates aTranslatableComponentRendererusing theTranslatorto translate.- Parameters:
- source- the translation source
- Returns:
- the renderer
- Since:
- 4.0.0
 
- 
translateGets a message format from a key and context.- Parameters:
- key- a translation key
- context- a context
- Returns:
- a message format or nullto skip translation
 
- 
renderBlockNbtprotected @NonNull Component renderBlockNbt(@NonNull BlockNBTComponent component, @NonNull 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
 
- 
renderEntityNbtprotected @NonNull Component renderEntityNbt(@NonNull EntityNBTComponent component, @NonNull 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
 
- 
renderStorageNbtprotected @NonNull Component renderStorageNbt(@NonNull StorageNBTComponent component, @NonNull 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 static <C extends NBTComponent<C, B>, B extends NBTComponentBuilder<C, B>> B nbt(B builder, C oldComponent)
- 
renderKeybindprotected @NonNull Component renderKeybind(@NonNull KeybindComponent component, @NonNull 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
 
- 
renderScoreDescription copied from class:AbstractComponentRendererRenders a score component.- Specified by:
- renderScorein class- AbstractComponentRenderer<C>
- Parameters:
- component- the component
- context- the context
- Returns:
- the rendered component
 
- 
renderSelectorprotected @NonNull Component renderSelector(@NonNull SelectorComponent component, @NonNull 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
 
- 
renderTextDescription copied from class:AbstractComponentRendererRenders a text component.- Specified by:
- renderTextin class- AbstractComponentRenderer<C>
- Parameters:
- component- the component
- context- the context
- Returns:
- the rendered component
 
- 
renderTranslatableprotected @NonNull Component renderTranslatable(@NonNull TranslatableComponent component, @NonNull 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(List<Component> children, B builder, C context)
- 
mergeStyleprotected <B extends ComponentBuilder<?, ?>> void mergeStyle(Component component, B builder, C context)
 
-