Interface MinecraftRenderer
-
- All Superinterfaces:
MinecraftNodeRenderer,NodeRenderer<net.kyori.adventure.text.Component>
- All Known Implementing Classes:
DefaultMinecraftRenderer
public interface MinecraftRenderer extends MinecraftNodeRenderer
Interface for rendering formattingNodes into MinecraftComponents for standardTextStyles.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @Nullable net.kyori.adventure.text.ComponentappendChannelMention(@NonNull net.kyori.adventure.text.Component component, @NonNull java.lang.String id)Renders a channel mention and appends it to the providedComponent.@Nullable net.kyori.adventure.text.ComponentappendEmoteMention(@NonNull net.kyori.adventure.text.Component component, @NonNull java.lang.String name, @NonNull java.lang.String id)Renders a emote mention and appends it to the providedComponent.@Nullable net.kyori.adventure.text.ComponentappendQuote(@NonNull net.kyori.adventure.text.Component component, @NonNull net.kyori.adventure.text.Component content)Adds the required formatting for quotes to the providedComponent.@Nullable net.kyori.adventure.text.ComponentappendRoleMention(@NonNull net.kyori.adventure.text.Component component, @NonNull java.lang.String id)Renders a role mention and appends it to the providedComponent.@Nullable net.kyori.adventure.text.ComponentappendSpoiler(@NonNull net.kyori.adventure.text.Component component, @NonNull net.kyori.adventure.text.Component content)Renders the spoiler and appends it to the providedComponent.@Nullable net.kyori.adventure.text.ComponentappendUserMention(@NonNull net.kyori.adventure.text.Component component, @NonNull java.lang.String id)Renders a user mention and appends it to the providedComponent.@Nullable net.kyori.adventure.text.Componentbold(@NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas bold.@Nullable net.kyori.adventure.text.ComponentcodeBlock(@NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas a code block.@Nullable net.kyori.adventure.text.ComponentcodeString(@NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas a code string.@Nullable net.kyori.adventure.text.Componentitalics(@NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas italics.default net.kyori.adventure.text.Componentrender(net.kyori.adventure.text.Component component, dev.vankka.simpleast.core.node.Node<java.lang.Object> node, MinecraftSerializerOptions<net.kyori.adventure.text.Component> serializerOptions, java.util.function.Function<dev.vankka.simpleast.core.node.Node<java.lang.Object>,net.kyori.adventure.text.Component> renderWithChildren)@Nullable net.kyori.adventure.text.Componentstrikethrough(@NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas strikethrough.@Nullable net.kyori.adventure.text.Componentunderline(@NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas underlined.-
Methods inherited from interface dev.vankka.mcdiscordreserializer.renderer.NodeRenderer
renderAfterChildren
-
-
-
-
Method Detail
-
render
default net.kyori.adventure.text.Component render(net.kyori.adventure.text.Component component, dev.vankka.simpleast.core.node.Node<java.lang.Object> node, MinecraftSerializerOptions<net.kyori.adventure.text.Component> serializerOptions, java.util.function.Function<dev.vankka.simpleast.core.node.Node<java.lang.Object>,net.kyori.adventure.text.Component> renderWithChildren)Description copied from interface:MinecraftNodeRenderer- Specified by:
renderin interfaceMinecraftNodeRenderer- Specified by:
renderin interfaceNodeRenderer<net.kyori.adventure.text.Component>- Parameters:
component- the input component to apply the node tonode- the nodeserializerOptions- the serializer options for this renderrenderWithChildren- a function to allow rendering a node recursively- Returns:
- the new component with the node applied to it
-
strikethrough
@Nullable net.kyori.adventure.text.Component strikethrough(@NonNull @NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas strikethrough.- Parameters:
part- theComponentto render as strikethrough- Returns:
- the strikethrough
Componentornullif this renderer does not process that kinds of styles
-
underline
@Nullable net.kyori.adventure.text.Component underline(@NonNull @NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas underlined.- Parameters:
part- theComponentto render as underlined- Returns:
- the underlined
Componentornullif this renderer does not process that kinds of styles
-
italics
@Nullable net.kyori.adventure.text.Component italics(@NonNull @NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas italics.- Parameters:
part- theComponentto render as italics- Returns:
- the italics
Componentornullif this renderer does not process that kinds of styles
-
bold
@Nullable net.kyori.adventure.text.Component bold(@NonNull @NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas bold.- Parameters:
part- theComponentto render as bold- Returns:
- the bold
Componentornullif this renderer does not process that kinds of styles
-
codeString
@Nullable net.kyori.adventure.text.Component codeString(@NonNull @NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas a code string.- Parameters:
part- theComponentto render the code string to- Returns:
- the code stringed
Componentornullif this renderer does not process that kinds of styles
-
codeBlock
@Nullable net.kyori.adventure.text.Component codeBlock(@NonNull @NonNull net.kyori.adventure.text.Component part)Renders the providedComponentas a code block.- Parameters:
part- theComponentto render as a code block- Returns:
- the code blocked
Componentornullif this renderer does not process that kinds of styles
-
appendSpoiler
@Nullable net.kyori.adventure.text.Component appendSpoiler(@NonNull @NonNull net.kyori.adventure.text.Component component, @NonNull @NonNull net.kyori.adventure.text.Component content)Renders the spoiler and appends it to the providedComponent.- Parameters:
component- theComponentto render the spoiler tocontent- the content of the spoiler- Returns:
- the spoiler'ed
Componentornullif this renderer does not process that kinds of styles
-
appendQuote
@Nullable net.kyori.adventure.text.Component appendQuote(@NonNull @NonNull net.kyori.adventure.text.Component component, @NonNull @NonNull net.kyori.adventure.text.Component content)Adds the required formatting for quotes to the providedComponent.- Parameters:
component- theComponentto render tocontent- the content of the quote- Returns:
- the
Componentwith the quote rendered ornullif this renderer does not process that kinds of styles
-
appendEmoteMention
@Nullable net.kyori.adventure.text.Component appendEmoteMention(@NonNull @NonNull net.kyori.adventure.text.Component component, @NonNull @NonNull java.lang.String name, @NonNull @NonNull java.lang.String id)Renders a emote mention and appends it to the providedComponent.- Parameters:
component- theComponentto render toname- the name of the emoteid- the id of the emote- Returns:
- the
Componentwith emote rendered ornullif this renderer does not process that kinds of styles
-
appendChannelMention
@Nullable net.kyori.adventure.text.Component appendChannelMention(@NonNull @NonNull net.kyori.adventure.text.Component component, @NonNull @NonNull java.lang.String id)Renders a channel mention and appends it to the providedComponent.- Parameters:
component- theComponentto render toid- the id of the channel- Returns:
- the
Componentwith the channel mention rendered ornullif this renderer does not process that kinds of styles
-
appendUserMention
@Nullable net.kyori.adventure.text.Component appendUserMention(@NonNull @NonNull net.kyori.adventure.text.Component component, @NonNull @NonNull java.lang.String id)Renders a user mention and appends it to the providedComponent.- Parameters:
component- theComponentto render toid- the id of the user- Returns:
- the
Componentwith the user mention rendered ornullif this renderer does not process that kinds of styles
-
appendRoleMention
@Nullable net.kyori.adventure.text.Component appendRoleMention(@NonNull @NonNull net.kyori.adventure.text.Component component, @NonNull @NonNull java.lang.String id)Renders a role mention and appends it to the providedComponent.- Parameters:
component- theComponentto render toid- the id of the role- Returns:
- the
Componentwith the role mention rendered ornullif this renderer does not process that kinds of styles
-
-