Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PluginMessageRecipient.java
1 package org.bukkit.plugin.messaging;
2 
3 import java.util.Set;
4 import org.bukkit.plugin.Plugin;
5 
6 /**
7  * Represents a possible recipient for a Plugin Message.
8  */
9 public interface PluginMessageRecipient {
10  /**
11  * Sends this recipient a Plugin Message on the specified outgoing
12  * channel.
13  * <p>
14  * The message may not be larger than {@link Messenger#MAX_MESSAGE_SIZE}
15  * bytes, and the plugin must be registered to send messages on the
16  * specified channel.
17  *
18  * @param source The plugin that sent this message.
19  * @param channel The channel to send this message on.
20  * @param message The raw message to send.
21  * @throws IllegalArgumentException Thrown if the source plugin is
22  * disabled.
23  * @throws IllegalArgumentException Thrown if source, channel or message
24  * is null.
25  * @throws MessageTooLargeException Thrown if the message is too big.
26  * @throws ChannelNotRegisteredException Thrown if the channel is not
27  * registered for this plugin.
28  */
29  public void sendPluginMessage(Plugin source, String channel, byte[] message);
30 
31  /**
32  * Gets a set containing all the Plugin Channels that this client is
33  * listening on.
34  *
35  * @return Set containing all the channels that this client may accept.
36  */
37  public Set<String> getListeningPluginChannels();
38 }
void sendPluginMessage(Plugin source, String channel, byte[] message)