类的使用
net.md_5.bungee.api.chat.BaseComponent
使用BaseComponent的程序包
程序包
说明
Bukkit API的顶级程序包, 包含通用的API类和接口.
与处理玩家输入的非聊天消息(即命令)相关的类.
为在
世界
内存在的非三维像素单位(实体)提供的接口,包含玩家、怪物、抛射物等.用于操作可以存储在
物品堆
的额外数据的接口.-
net.md_5.bungee.api.chat中BaseComponent的使用
修饰符和类型类说明final class
final class
This component displays the score based on a player score on the scoreboard.final class
This component processes a target selector into a pre-formatted set of discovered names.final class
final class
修饰符和类型方法说明ComponentBuilder.create()
Returns the components needed to display the message created by this builder.gitabstract BaseComponent
BaseComponent.duplicate()
克隆本组件并返回克隆副本.BaseComponent.duplicateWithoutFormatting()
已过时。不鼓励使用本 API, 建议使用传统克隆副本static BaseComponent[]
TextComponent.fromLegacyText
(String message) Converts the old formatting system that usedChatColor.COLOR_CHAR
into the new json based system.static BaseComponent[]
TextComponent.fromLegacyText
(String message, ChatColor defaultColor) Converts the old formatting system that usedChatColor.COLOR_CHAR
into the new json based system.ComponentBuilder.getComponent
(int pos) Gets the component part at the position of given index.ComponentBuilder.getCurrentComponent()
Gets the component at the position of the cursor.HoverEvent.getValue()
已过时。返回变量类型为BaseComponent的类型的net.md_5.bungee.api.chat中的方法修饰符和类型方法说明BaseComponent.getExtra()
继承该组件的格式和事件的附加组件.ComponentBuilder.getParts()
TranslatableComponent.getWith()
The components to substitute into the translation参数类型为BaseComponent的net.md_5.bungee.api.chat中的方法修饰符和类型方法说明void
BaseComponent.addExtra
(BaseComponent component) Appends a component to the component.void
TranslatableComponent.addWith
(BaseComponent component) Adds a component substitution to the component.ComponentBuilder.append
(BaseComponent component) Appends a component to the builder and makes it the current target for formatting.ComponentBuilder.append
(BaseComponent[] components) Appends the components to the builder and makes the last element the current target for formatting.ComponentBuilder.append
(BaseComponent[] components, ComponentBuilder.FormatRetention retention) Appends the components to the builder and makes the last element the current target for formatting.ComponentBuilder.append
(BaseComponent component, ComponentBuilder.FormatRetention retention) Appends a component to the builder and makes it the current target for formatting.void
BaseComponent.copyFormatting
(BaseComponent component) 复制指定 BaseComponent 的事件和格式.void
BaseComponent.copyFormatting
(BaseComponent component, boolean replace) 复制指定 BaseComponent 的事件和格式.void
BaseComponent.copyFormatting
(BaseComponent component, ComponentBuilder.FormatRetention retention, boolean replace) 复制某个 BaseComponent 中的指定格式.static String
BaseComponent.toLegacyText
(BaseComponent... components) 将聊天组件转化为颜色代码文本.static String
BaseComponent.toPlainText
(BaseComponent... components) 将聊天组件转化为字符串, 丢弃所有格式.类型变量类型为BaseComponent的net.md_5.bungee.api.chat中的方法参数修饰符和类型方法说明void
BaseComponent.setExtra
(List<BaseComponent> components) void
TranslatableComponent.setWith
(List<BaseComponent> components) Sets the translation substitutions to be used in this component.参数类型为BaseComponent的net.md_5.bungee.api.chat中的构造器限定符构造器说明ComponentBuilder
(BaseComponent component) Creates a ComponentBuilder with the given component as the first part.HoverEvent
(HoverEvent.Action action, BaseComponent[] value) TextComponent
(BaseComponent... extras) Creates a TextComponent with blank text and the extras set to the passed array -
net.md_5.bungee.api.chat.hover.content中BaseComponent的使用
-
net.md_5.bungee.chat中BaseComponent的使用
类型参数类型为BaseComponent的net.md_5.bungee.chat中的字段修饰符和类型方法说明ComponentSerializer.deserialize
(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) static BaseComponent[]
参数类型为BaseComponent的net.md_5.bungee.chat中的方法修饰符和类型方法说明protected void
BaseComponentSerializer.deserialize
(com.google.gson.JsonObject object, BaseComponent component, com.google.gson.JsonDeserializationContext context) protected void
BaseComponentSerializer.serialize
(com.google.gson.JsonObject object, BaseComponent component, com.google.gson.JsonSerializationContext context) static String
ComponentSerializer.toString
(BaseComponent component) static String
ComponentSerializer.toString
(BaseComponent... components) -
org.bukkit中BaseComponent的使用
参数类型为BaseComponent的org.bukkit中的方法修饰符和类型方法说明void
Server.Spigot.broadcast
(@NotNull BaseComponent... components) 将多个聊天消息组件作为单条消息广播给所有在线玩家.void
Server.Spigot.broadcast
(BaseComponent component) 向全体玩家广播一条消息. -
org.bukkit.command中BaseComponent的使用
参数类型为BaseComponent的org.bukkit.command中的方法修饰符和类型方法说明void
CommandSender.Spigot.sendMessage
(@NotNull BaseComponent... components) 将多个聊天消息组件作为单条消息发送给命令发送者.void
CommandSender.Spigot.sendMessage
(@Nullable UUID sender, @NotNull BaseComponent... components) 将多个聊天消息组件作为单条消息发送给命令发送者.void
CommandSender.Spigot.sendMessage
(@Nullable UUID sender, BaseComponent component) 向命令发送者发送一个聊天消息组件.void
CommandSender.Spigot.sendMessage
(BaseComponent component) 向命令发送者发送一个聊天消息组件. -
org.bukkit.entity中BaseComponent的使用
参数类型为BaseComponent的org.bukkit.entity中的方法修饰符和类型方法说明void
Player.Spigot.sendMessage
(@NotNull BaseComponent... components) void
Player.Spigot.sendMessage
(BaseComponent component) void
Player.Spigot.sendMessage
(ChatMessageType position, @NotNull BaseComponent... components) 将多个聊天消息组件作为单条消息发送给玩家, 并指定消息的展示位置.void
Player.Spigot.sendMessage
(ChatMessageType position, UUID sender, @NotNull BaseComponent... components) 将多个聊天消息组件作为单条消息发送给玩家, 并指定消息的展示位置.void
Player.Spigot.sendMessage
(ChatMessageType position, UUID sender, BaseComponent component) 向玩家发送在指定位置展示的聊天消息组件.void
Player.Spigot.sendMessage
(ChatMessageType position, BaseComponent component) 向玩家发送在指定位置展示的聊天消息组件. -
org.bukkit.inventory.meta中BaseComponent的使用
参数类型为BaseComponent的org.bukkit.inventory.meta中的方法修饰符和类型方法说明void
BookMeta.Spigot.addPage
(@NotNull BaseComponent[]... pages) 在书本末尾追加新的书页.void
BookMeta.Spigot.setPage
(int page, @Nullable BaseComponent... data) 设置书本指定书页的内容.void
BookMeta.Spigot.setPages
(@NotNull BaseComponent[]... pages) 清除书本所有书页, 并设置书本使用提供的书页内容.