接口 PluginMessageRecipient

所有已知子接口:
Player, Server, World

public interface PluginMessageRecipient
代表插件消息(Plugin Message)可能的接收者.
  • 方法概要

    修饰符和类型
    方法
    说明
    获取包含了客户端正在监听的插件通道(Plugin Channel)的set集合.
    void
    sendPluginMessage(Plugin source, String channel, byte[] message)
    在指定的通道向接收者发送插件消息(Plugin Message).
  • 方法详细资料

    • sendPluginMessage

      void sendPluginMessage(Plugin source, String channel, byte[] message)
      在指定的通道向接收者发送插件消息(Plugin Message).

      这个消息可能不大于Messenger.MAX_MESSAGE_SIZE字节,还有插件必须注册到指定的通道上发消息.

      原文:Sends this recipient a Plugin Message on the specified outgoing channel.

      The message may not be larger than Messenger.MAX_MESSAGE_SIZE bytes, and the plugin must be registered to send messages on the specified channel.

      参数:
      source - 要让插件发送的消息
      channel - The channel to send this message on.在某通道上发送这个消息
      message - 要发送的原始消息The raw message to send.
      抛出:
      IllegalArgumentException - 如果插件被禁用则抛出
      IllegalArgumentException - 如果参数source,channel或message为null则抛出
      MessageTooLargeException - 如果消息过大则抛出
      ChannelNotRegisteredException - 如果这个通道不是为这个插件注册的则抛出
    • getListeningPluginChannels

      Set<String> getListeningPluginChannels()
      获取包含了客户端正在监听的插件通道(Plugin Channel)的set集合.

      原文:Gets a set containing all the Plugin Channels that this client is listening on.

      返回:
      包含了客户端可以接受的通道的set集合