2012-04-18 19:18:25 +02:00
|
|
|
package com.gmail.nossr50.api;
|
|
|
|
|
2013-01-27 00:19:13 +01:00
|
|
|
import org.bukkit.plugin.Plugin;
|
|
|
|
|
2013-01-26 00:21:17 +01:00
|
|
|
import com.gmail.nossr50.party.PartyManager;
|
|
|
|
import com.gmail.nossr50.util.ChatManager;
|
2012-04-18 19:18:25 +02:00
|
|
|
|
2012-06-06 22:03:15 +02:00
|
|
|
public final class ChatAPI {
|
|
|
|
private ChatAPI() {}
|
|
|
|
|
2013-02-02 00:59:22 +01:00
|
|
|
/**
|
|
|
|
* Send a message to all members of a party
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
|
|
|
* @param plugin The plugin sending the message
|
|
|
|
* @param sender The name of the sender
|
|
|
|
* @param displayName The display name of the sender
|
|
|
|
* @param party The name of the party to send to
|
|
|
|
* @param message The message to send
|
|
|
|
*/
|
|
|
|
public static void sendPartyChat(Plugin plugin, String sender, String displayName, String party, String message) {
|
|
|
|
ChatManager.handlePartyChat(plugin, PartyManager.getParty(party), sender, displayName, message);
|
|
|
|
}
|
|
|
|
|
2012-04-18 19:18:25 +02:00
|
|
|
/**
|
|
|
|
* Send a message to all members of a party
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
2013-01-27 00:19:13 +01:00
|
|
|
* @param plugin The plugin sending the message
|
|
|
|
* @param sender The name of the sender to display in the chat
|
|
|
|
* @param party The name of the party to send to
|
|
|
|
* @param message The message to send
|
|
|
|
*/
|
|
|
|
public static void sendPartyChat(Plugin plugin, String sender, String party, String message) {
|
2013-02-02 00:59:22 +01:00
|
|
|
ChatManager.handlePartyChat(plugin, PartyManager.getParty(party), sender, sender, message);
|
2013-01-27 00:19:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send a message to all members of a party
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
|
|
|
* @deprecated Replaced by sendPartyChat(Plugin, String, String, String)
|
|
|
|
*
|
2012-04-18 19:18:25 +02:00
|
|
|
* @param sender The name of the sender to display in the chat
|
|
|
|
* @param party The name of the party to send to
|
|
|
|
* @param message The message to send
|
|
|
|
*/
|
2013-01-27 00:19:13 +01:00
|
|
|
@Deprecated
|
2012-06-06 22:03:15 +02:00
|
|
|
public static void sendPartyChat(String sender, String party, String message) {
|
2013-02-02 00:59:22 +01:00
|
|
|
sendPartyChat(null, party, sender, sender, message);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send a message to administrators
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
|
|
|
* @param plugin The plugin sending the message
|
|
|
|
* @param sender The name of the sender
|
|
|
|
* @param displayName The display name of the sender
|
|
|
|
* @param message The message to send
|
|
|
|
*/
|
|
|
|
public static void sendAdminChat(Plugin plugin, String sender, String displayName, String message) {
|
|
|
|
ChatManager.handleAdminChat(plugin, sender, displayName, message);
|
2012-04-18 19:18:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send a message to administrators
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
2013-01-27 00:19:13 +01:00
|
|
|
* @param plugin The plugin sending the message
|
|
|
|
* @param sender The name of the sender to display in the chat
|
|
|
|
* @param message The message to send
|
|
|
|
*/
|
|
|
|
public static void sendAdminChat(Plugin plugin, String sender, String message) {
|
2013-02-02 00:59:22 +01:00
|
|
|
ChatManager.handleAdminChat(plugin, sender, sender, message);
|
2013-01-27 00:19:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send a message to administrators
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
|
|
|
* @deprecated Replaced by sendAdminChat(Plugin, String, String)
|
|
|
|
*
|
2012-04-18 19:18:25 +02:00
|
|
|
* @param sender The name of the sender to display in the chat
|
|
|
|
* @param message The message to send
|
|
|
|
*/
|
2013-01-27 00:19:13 +01:00
|
|
|
@Deprecated
|
2012-06-06 22:03:15 +02:00
|
|
|
public static void sendAdminChat(String sender, String message) {
|
2013-02-02 00:59:22 +01:00
|
|
|
sendAdminChat(null, sender, sender, message);
|
2012-04-18 19:18:25 +02:00
|
|
|
}
|
|
|
|
}
|