Class DefaultMinecraftRenderer
- java.lang.Object
-
- dev.vankka.mcdiscordreserializer.renderer.implementation.DefaultMinecraftRenderer
-
- All Implemented Interfaces:
MinecraftNodeRenderer,MinecraftRenderer,NodeRenderer<net.kyori.adventure.text.Component>
public class DefaultMinecraftRenderer extends java.lang.Object implements MinecraftRenderer
The default implementation for theMinecraftRenderer.
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultMinecraftRendererINSTANCEThe instance ofDefaultMinecraftRenderer.
-
Constructor Summary
Constructors Constructor Description DefaultMinecraftRenderer()Creates a new instance of theDefaultMinecraftRendererunless you're extending the class you shouldn't use this.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description net.kyori.adventure.text.ComponentappendChannelMention(net.kyori.adventure.text.Component component, java.lang.String id)Renders a channel mention and appends it to the providedComponent.net.kyori.adventure.text.ComponentappendEmoteMention(net.kyori.adventure.text.Component component, java.lang.String name, java.lang.String id)Renders a emote mention and appends it to the providedComponent.net.kyori.adventure.text.ComponentappendQuote(net.kyori.adventure.text.Component component, net.kyori.adventure.text.Component content)Adds the required formatting for quotes to the providedComponent.net.kyori.adventure.text.ComponentappendRoleMention(net.kyori.adventure.text.Component component, java.lang.String id)Renders a role mention and appends it to the providedComponent.net.kyori.adventure.text.ComponentappendSpoiler(net.kyori.adventure.text.Component component, net.kyori.adventure.text.Component content)Renders the spoiler and appends it to the providedComponent.net.kyori.adventure.text.ComponentappendUserMention(net.kyori.adventure.text.Component component, java.lang.String id)Renders a user mention and appends it to the providedComponent.net.kyori.adventure.text.Componentbold(net.kyori.adventure.text.Component component)Renders the providedComponentas bold.net.kyori.adventure.text.ComponentcodeBlock(net.kyori.adventure.text.Component component)Renders the providedComponentas a code block.net.kyori.adventure.text.ComponentcodeString(net.kyori.adventure.text.Component component)Renders the providedComponentas a code string.net.kyori.adventure.text.Componentitalics(net.kyori.adventure.text.Component component)Renders the providedComponentas italics.net.kyori.adventure.text.Componentstrikethrough(net.kyori.adventure.text.Component component)Renders the providedComponentas strikethrough.net.kyori.adventure.text.Componentunderline(net.kyori.adventure.text.Component component)Renders the providedComponentas underlined.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface dev.vankka.mcdiscordreserializer.renderer.MinecraftRenderer
render
-
Methods inherited from interface dev.vankka.mcdiscordreserializer.renderer.NodeRenderer
renderAfterChildren
-
-
-
-
Field Detail
-
INSTANCE
public static final DefaultMinecraftRenderer INSTANCE
The instance ofDefaultMinecraftRenderer.
-
-
Constructor Detail
-
DefaultMinecraftRenderer
public DefaultMinecraftRenderer()
Creates a new instance of theDefaultMinecraftRendererunless you're extending the class you shouldn't use this.- See Also:
INSTANCE
-
-
Method Detail
-
strikethrough
public net.kyori.adventure.text.Component strikethrough(net.kyori.adventure.text.Component component)
Description copied from interface:MinecraftRendererRenders the providedComponentas strikethrough.- Specified by:
strikethroughin interfaceMinecraftRenderer- Parameters:
component- theComponentto render as strikethrough- Returns:
- the strikethrough
Componentornullif this renderer does not process that kinds of styles
-
underline
public net.kyori.adventure.text.Component underline(net.kyori.adventure.text.Component component)
Description copied from interface:MinecraftRendererRenders the providedComponentas underlined.- Specified by:
underlinein interfaceMinecraftRenderer- Parameters:
component- theComponentto render as underlined- Returns:
- the underlined
Componentornullif this renderer does not process that kinds of styles
-
italics
public net.kyori.adventure.text.Component italics(net.kyori.adventure.text.Component component)
Description copied from interface:MinecraftRendererRenders the providedComponentas italics.- Specified by:
italicsin interfaceMinecraftRenderer- Parameters:
component- theComponentto render as italics- Returns:
- the italics
Componentornullif this renderer does not process that kinds of styles
-
bold
public net.kyori.adventure.text.Component bold(net.kyori.adventure.text.Component component)
Description copied from interface:MinecraftRendererRenders the providedComponentas bold.- Specified by:
boldin interfaceMinecraftRenderer- Parameters:
component- theComponentto render as bold- Returns:
- the bold
Componentornullif this renderer does not process that kinds of styles
-
codeString
public net.kyori.adventure.text.Component codeString(net.kyori.adventure.text.Component component)
Description copied from interface:MinecraftRendererRenders the providedComponentas a code string.- Specified by:
codeStringin interfaceMinecraftRenderer- Parameters:
component- theComponentto render the code string to- Returns:
- the code stringed
Componentornullif this renderer does not process that kinds of styles
-
codeBlock
public net.kyori.adventure.text.Component codeBlock(net.kyori.adventure.text.Component component)
Description copied from interface:MinecraftRendererRenders the providedComponentas a code block.- Specified by:
codeBlockin interfaceMinecraftRenderer- Parameters:
component- theComponentto render as a code block- Returns:
- the code blocked
Componentornullif this renderer does not process that kinds of styles
-
appendSpoiler
public net.kyori.adventure.text.Component appendSpoiler(net.kyori.adventure.text.Component component, net.kyori.adventure.text.Component content)Description copied from interface:MinecraftRendererRenders the spoiler and appends it to the providedComponent.- Specified by:
appendSpoilerin interfaceMinecraftRenderer- 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
public net.kyori.adventure.text.Component appendQuote(net.kyori.adventure.text.Component component, net.kyori.adventure.text.Component content)Description copied from interface:MinecraftRendererAdds the required formatting for quotes to the providedComponent.- Specified by:
appendQuotein interfaceMinecraftRenderer- 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
public net.kyori.adventure.text.Component appendEmoteMention(net.kyori.adventure.text.Component component, java.lang.String name, java.lang.String id)Description copied from interface:MinecraftRendererRenders a emote mention and appends it to the providedComponent.- Specified by:
appendEmoteMentionin interfaceMinecraftRenderer- 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
public net.kyori.adventure.text.Component appendChannelMention(net.kyori.adventure.text.Component component, java.lang.String id)Description copied from interface:MinecraftRendererRenders a channel mention and appends it to the providedComponent.- Specified by:
appendChannelMentionin interfaceMinecraftRenderer- 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
public net.kyori.adventure.text.Component appendUserMention(net.kyori.adventure.text.Component component, java.lang.String id)Description copied from interface:MinecraftRendererRenders a user mention and appends it to the providedComponent.- Specified by:
appendUserMentionin interfaceMinecraftRenderer- 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
public net.kyori.adventure.text.Component appendRoleMention(net.kyori.adventure.text.Component component, java.lang.String id)Description copied from interface:MinecraftRendererRenders a role mention and appends it to the providedComponent.- Specified by:
appendRoleMentionin interfaceMinecraftRenderer- 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
-
-