接口 Messenger
- 所有已知实现类:
- StandardMessenger
NamespacedKey. The "BungeeCord" channel is
 an exception and may only take this form.- 
字段概要字段修饰符和类型字段说明static final int代表单个插件通道的最大大小.static final int代表单个插件消息的最大大小.
- 
方法概要修饰符和类型方法说明voiddispatchIncomingMessage(@NotNull Player source, @NotNull String channel, @org.jetbrains.annotations.NotNull byte[] message) 调度指定接收消息的任何注册过的监听器.获取一个包含了所有在请求通道上的接收的插件通道的注册的set集合.获取一个包含了指定插件拥有的所有接收的插件通道的注册的set集合.getIncomingChannelRegistrations(@NotNull Plugin plugin, @NotNull String channel) 获取一个包含了指定插件在请求的通道上的所有接收的插件通道的注册的set集合.获取包含了所有接收的插件通道的set集合.getIncomingChannels(@NotNull Plugin plugin) 获取一个包含了指定插件注册的所有接收的插件通道的set集合.获取包含了所有向外发送的插件通道的set集合.getOutgoingChannels(@NotNull Plugin plugin) 获取一个包含了指定插件注册的全部向外发送的插件通道的set集合.booleanisIncomingChannelRegistered(@NotNull Plugin plugin, @NotNull String channel) 检测指定插件注册的传入的消息是否通过了请求的通道.booleanisOutgoingChannelRegistered(@NotNull Plugin plugin, @NotNull String channel) 检测指定插件注册的发送的消息是否通过了请求的通道.booleanisRegistrationValid(@NotNull PluginMessageListenerRegistration registration) 检测指定插件消息监听器的注册是否有效.booleanisReservedChannel(@NotNull String channel) 检测指定的通道名称是否为保留名称.registerIncomingPluginChannel(@NotNull Plugin plugin, @NotNull String channel, @NotNull PluginMessageListener listener) 注册指定的监听指定的接收的插件通道的插件,允许它在任何插件消息上做动作.voidregisterOutgoingPluginChannel(@NotNull Plugin plugin, @NotNull String channel) 注册指定插件所请求的发送插件通道,允许它通过这个通道向任何客户端发送消息.void注销指定插件在所有监听器上监听的插件通道.voidunregisterIncomingPluginChannel(@NotNull Plugin plugin, @NotNull String channel) 注销指定插件请求的监听的接收的插件通道,不再允许它在任何插件消息上做动作.voidunregisterIncomingPluginChannel(@NotNull Plugin plugin, @NotNull String channel, @NotNull PluginMessageListener listener) 注销指定插件请求的监听接收的插件通道的监听器,不再允许它在任何插件消息上做任何动作.void注销指定插件的所有向外发送插件通道,不再允许它发送任何插件消息.voidunregisterOutgoingPluginChannel(@NotNull Plugin plugin, @NotNull String channel) 注销指定插件请求的插件发送通道,不再允许它通过这个通道发送消息到任何客户端.
- 
字段详细资料
- 
方法详细资料- 
isReservedChannel检测指定的通道名称是否为保留名称.
 所有处于"minecraft"命名空间的通道都是被保留的, 除了"minecraft:brand".原文:Checks if the specified channel is a reserved name. 
 All channels within the "minecraft" namespace except for "minecraft:brand" are reserved.- 参数:
- channel- 要检测的通道名称
- 返回:
- 如果这个通道是保留的则为true,反之为false
- 抛出:
- IllegalArgumentException- 如果参数channel为null
 
- 
registerOutgoingPluginChannelvoid registerOutgoingPluginChannel(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String channel) 注册指定插件所请求的发送插件通道,允许它通过这个通道向任何客户端发送消息.原文:Registers the specific plugin to the requested outgoing plugin channel, allowing it to send messages through that channel to any clients. - 参数:
- plugin- 希望通过该通过发送消息的插件
- channel- 要注册的通道
- 抛出:
- IllegalArgumentException- 如果参数plugin或channel为null
 
- 
unregisterOutgoingPluginChannelvoid unregisterOutgoingPluginChannel(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String channel) 注销指定插件请求的插件发送通道,不再允许它通过这个通道发送消息到任何客户端.原文:Unregisters the specific plugin from the requested outgoing plugin channel, no longer allowing it to send messages through that channel to any clients. - 参数:
- plugin- 不再希望通过此通道发送消息的插件
- channel- 要注销的通道
- 抛出:
- IllegalArgumentException- 如果参数plugin或channel为null
 
- 
unregisterOutgoingPluginChannel注销指定插件的所有向外发送插件通道,不再允许它发送任何插件消息.原文:Unregisters the specific plugin from all outgoing plugin channels, no longer allowing it to send any plugin messages. - 参数:
- plugin- 不再希望发送插件消息的插件
- 抛出:
- IllegalArgumentException- 如果参数plugin为null
 
- 
registerIncomingPluginChannel@NotNull @NotNull PluginMessageListenerRegistration registerIncomingPluginChannel(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String channel, @NotNull @NotNull PluginMessageListener listener) 注册指定的监听指定的接收的插件通道的插件,允许它在任何插件消息上做动作.原文:Registers the specific plugin for listening on the requested incoming plugin channel, allowing it to act upon any plugin messages. - 参数:
- plugin- 希望注册这个通道的插件
- channel- 要注册的通道
- listener- 要接收消息的监听器
- 返回:
- 注册后的结果(一个对象)
- 抛出:
- IllegalArgumentException- 如果参数plugin,channel或listener为null或这个监听器已注册这个通道
 
- 
unregisterIncomingPluginChannelvoid unregisterIncomingPluginChannel(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String channel, @NotNull @NotNull PluginMessageListener listener) 注销指定插件请求的监听接收的插件通道的监听器,不再允许它在任何插件消息上做任何动作.原文:Unregisters the specific plugin's listener from listening on the requested incoming plugin channel, no longer allowing it to act upon any plugin messages. - 参数:
- plugin- 希望注销这个通道的插件
- channel- 要注销的通道
- listener- 要停止接收消息的监听器
- 抛出:
- IllegalArgumentException- 如果参数plugin,channel或listener为null
 
- 
unregisterIncomingPluginChannelvoid unregisterIncomingPluginChannel(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String channel) 注销指定插件请求的监听的接收的插件通道,不再允许它在任何插件消息上做动作.原文:Unregisters the specific plugin from listening on the requested incoming plugin channel, no longer allowing it to act upon any plugin messages. - 参数:
- plugin- 希望注销这个通道的插件
- channel- 要注销的通道
- 抛出:
- IllegalArgumentException- 如果参数plugin或channel为null
 
- 
unregisterIncomingPluginChannel注销指定插件在所有监听器上监听的插件通道.原文:Unregisters the specific plugin from listening on all plugin channels through all listeners. - 参数:
- plugin- 希望注销这些通道的插件
- 抛出:
- IllegalArgumentException- 如果参数plugin为null
 
- 
getOutgoingChannels获取包含了所有向外发送的插件通道的set集合.原文:Gets a set containing all the outgoing plugin channels. - 返回:
- 已注册的所有发送插件通道的列表
 
- 
getOutgoingChannels获取一个包含了指定插件注册的全部向外发送的插件通道的set集合.原文:Gets a set containing all the outgoing plugin channels that the specified plugin is registered to. - 参数:
- plugin- 要检索通道的插件
- 返回:
- 所有这个插件注册的正在发送的插件通道的列表
- 抛出:
- IllegalArgumentException- 如果参数plugin为null
 
- 
getIncomingChannels获取包含了所有接收的插件通道的set集合.原文:Gets a set containing all the incoming plugin channels. - 返回:
- 已注册的所有正在接收的插件通道的列表
 
- 
getIncomingChannels获取一个包含了指定插件注册的所有接收的插件通道的set集合.原文:Gets a set containing all the incoming plugin channels that the specified plugin is registered for. - 参数:
- plugin- 要检索通道的插件
- 返回:
- 所有这个插件注册的正在接收的插件通道的列表
- 抛出:
- IllegalArgumentException- 如果参数plugin为null
 
- 
getIncomingChannelRegistrations@NotNull @NotNull Set<PluginMessageListenerRegistration> getIncomingChannelRegistrations(@NotNull @NotNull Plugin plugin) 获取一个包含了指定插件拥有的所有接收的插件通道的注册的set集合.原文:Gets a set containing all the incoming plugin channel registrations that the specified plugin has. - 参数:
- plugin- 要检索注册的插件
- 返回:
- 这个插件注册的所有注册的列表
- 抛出:
- IllegalArgumentException- 如果参数plugin为null
 
- 
getIncomingChannelRegistrations@NotNull @NotNull Set<PluginMessageListenerRegistration> getIncomingChannelRegistrations(@NotNull @NotNull String channel) 获取一个包含了所有在请求通道上的接收的插件通道的注册的set集合.原文:Gets a set containing all the incoming plugin channel registrations that are on the requested channel. - 参数:
- channel- 要检索注册的通道
- 返回:
- 在这个通道上注册的所有注册的列表
- 抛出:
- IllegalArgumentException- 如果参数channel为null
 
- 
getIncomingChannelRegistrations@NotNull @NotNull Set<PluginMessageListenerRegistration> getIncomingChannelRegistrations(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String channel) 获取一个包含了指定插件在请求的通道上的所有接收的插件通道的注册的set集合.原文:Gets a set containing all the incoming plugin channel registrations that the specified plugin has on the requested channel. - 参数:
- plugin- 要检索注册的插件
- channel- 由某个通道过滤注册
- 返回:
- 这个插件拥有的所有注册的列表
- 抛出:
- IllegalArgumentException- 如果参数plugin或channel为null
 
- 
isRegistrationValid检测指定插件消息监听器的注册是否有效.如果它没有注册以及插件仍然启用,那么注册就是有效的. 原文:Checks if the specified plugin message listener registration is valid. A registration is considered valid if it has not be unregistered and that the plugin is still enabled. - 参数:
- registration- 要检测的注册
- 返回:
- 如果注册是有效的则为true,false反之
 
- 
isIncomingChannelRegisteredboolean isIncomingChannelRegistered(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String channel) 检测指定插件注册的传入的消息是否通过了请求的通道.译注:按方法名来看,应该是检测指定正在接收的通道是否在这个插件上注册过. 原文:Checks if the specified plugin has registered to receive incoming messages through the requested channel. - 参数:
- plugin- 要检测注册的插件
- channel- 要检测的通道
- 返回:
- 如果通道已注册则为true,false反之
 
- 
isOutgoingChannelRegisteredboolean isOutgoingChannelRegistered(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String channel) 检测指定插件注册的发送的消息是否通过了请求的通道.译注:按方法名来看,应该是检测指定正在发送的通道是否在这个插件上注册过. 原文:Checks if the specified plugin has registered to send outgoing messages through the requested channel. - 参数:
- plugin- 要检测注册的插件
- channel- 要检测的通道
- 返回:
- 如果通道已注册则为true,false反之
 
- 
dispatchIncomingMessagevoid dispatchIncomingMessage(@NotNull @NotNull Player source, @NotNull @NotNull String channel, @NotNull @org.jetbrains.annotations.NotNull byte[] message) 调度指定接收消息的任何注册过的监听器.原文:Dispatches the specified incoming message to any registered listeners. - 参数:
- source- 消息源
- channel- 通过什么通道发送的消息
- message- 消息的原始有效载荷
 
 
-