类 MessageBuilder
java.lang.Object
cn.afternode.commons.bukkit.message.MessageBuilder
-
构造器概要
构造器构造器说明MessageBuilder(@Nullable cn.afternode.commons.localizations.ILocalizations locale) MessageBuilder(@Nullable cn.afternode.commons.localizations.ILocalizations locale, @Nullable net.kyori.adventure.text.ComponentLike linePrefix, @Nullable org.bukkit.command.CommandSender sender) -
方法概要
修饰符和类型方法说明append(net.kyori.adventure.text.ComponentLike componentLike) Append adventure componentnet.kyori.adventure.text.TextComponentbuild()Convert this builder to an Adventure componentclick(net.kyori.adventure.text.event.ClickEvent event) Append click eventAppend empty linenet.kyori.adventure.text.ComponentLikecn.afternode.commons.localizations.ILocalizationsorg.bukkit.command.CommandSenderhover(net.kyori.adventure.text.event.HoverEventSource<?> source) Append HoverEventline()Append new line with prefixlinePrefix(net.kyori.adventure.text.ComponentLike prefix) localizations(cn.afternode.commons.localizations.ILocalizations localizations) Append localized text, a localizations object must be passed to this builderAppend MiniMessage
MiniMessage docspermission(String permission, net.kyori.adventure.text.ComponentLike componentLike) Check sender permission and append adventure component, a CommandSender must be passed to this builderpermission(org.bukkit.permissions.Permission permission, net.kyori.adventure.text.ComponentLike component) Check sender permission and append adventure component, a CommandSender must be passed to this buildervoidsend()Convert this builder to Adventure component and send it to sender of this builder
A sender must be passed to this buildervoidsend(org.bukkit.command.CommandSender sender) Convert this builder to Adventure component and send it to sendersender(org.bukkit.command.CommandSender sender) Append raw textAppend colored raw text
-
构造器详细资料
-
MessageBuilder
public MessageBuilder(@Nullable @Nullable cn.afternode.commons.localizations.ILocalizations locale, @Nullable @Nullable net.kyori.adventure.text.ComponentLike linePrefix, @Nullable @Nullable org.bukkit.command.CommandSender sender) -
MessageBuilder
public MessageBuilder(@Nullable @Nullable cn.afternode.commons.localizations.ILocalizations locale) -
MessageBuilder
public MessageBuilder()
-
-
方法详细资料
-
localize
Append localized text, a localizations object must be passed to this builder- 参数:
key- Localization keyplaceholders- Localization placeholder- 返回:
- This builder
- 另请参阅:
-
localizationslocalizations(ILocalizations)ILocalizations.get(String, Map)
-
text
Append raw text- 参数:
text- Raw text- 返回:
- This builder
-
text
Append colored raw text- 参数:
text- Raw textcolor- AWT color- 返回:
- This builder
- 另请参阅:
-
mini
Append MiniMessage
MiniMessage docs- 参数:
mini- MiniMessage string- 返回:
- This builder
-
hover
Append HoverEvent- 参数:
source- Event source- 返回:
- This builder
- 另请参阅:
-
HoverEvent
-
click
Append click event- 参数:
event- Event- 返回:
- This builder
- 另请参阅:
-
ClickEvent
-
append
Append adventure component- 参数:
componentLike- Component- 返回:
- This builder
- 另请参阅:
-
Component
-
line
Append new line with prefix- 返回:
- This builder
- 另请参阅:
-
linePrefixlinePrefix(ComponentLike)
-
emptyLine
Append empty line- 返回:
- This builder
-
permission
public MessageBuilder permission(String permission, net.kyori.adventure.text.ComponentLike componentLike) Check sender permission and append adventure component, a CommandSender must be passed to this builder- 参数:
permission- Permission to checkcomponentLike- Adventure component- 返回:
- This builder
- 另请参阅:
-
sendersender(CommandSender)
-
permission
public MessageBuilder permission(org.bukkit.permissions.Permission permission, net.kyori.adventure.text.ComponentLike component) Check sender permission and append adventure component, a CommandSender must be passed to this builder- 参数:
permission- Permission to checkcomponent- Adventure component- 返回:
- This builder
- 另请参阅:
-
sendersender(CommandSender)
-
build
public net.kyori.adventure.text.TextComponent build()Convert this builder to an Adventure component- 返回:
- Adventure component
-
send
public void send()Convert this builder to Adventure component and send it to sender of this builder
A sender must be passed to this builder- 另请参阅:
-
sender(CommandSender)senderbuild()
-
send
public void send(org.bukkit.command.CommandSender sender) Convert this builder to Adventure component and send it to sender -
getLocalizations
public cn.afternode.commons.localizations.ILocalizations getLocalizations() -
localizations
public MessageBuilder localizations(cn.afternode.commons.localizations.ILocalizations localizations) -
getLinePrefix
public net.kyori.adventure.text.ComponentLike getLinePrefix() -
linePrefix
-
getSender
public org.bukkit.command.CommandSender getSender() -
sender
-