mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	Adding support for both display names and sender names in the chat API.
This commit is contained in:
		@@ -8,6 +8,21 @@ import com.gmail.nossr50.util.ChatManager;
 | 
			
		||||
public final class ChatAPI {
 | 
			
		||||
    private ChatAPI() {}
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Send a message to all members of a party
 | 
			
		||||
     * </br>
 | 
			
		||||
@@ -19,7 +34,7 @@ public final class ChatAPI {
 | 
			
		||||
     * @param message The message to send
 | 
			
		||||
     */
 | 
			
		||||
    public static void sendPartyChat(Plugin plugin, String sender, String party, String message) {
 | 
			
		||||
        ChatManager.handlePartyChat(plugin, PartyManager.getParty(party), sender, message);
 | 
			
		||||
        ChatManager.handlePartyChat(plugin, PartyManager.getParty(party), sender, sender, message);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -35,7 +50,21 @@ public final class ChatAPI {
 | 
			
		||||
     */
 | 
			
		||||
    @Deprecated
 | 
			
		||||
    public static void sendPartyChat(String sender, String party, String message) {
 | 
			
		||||
        sendPartyChat(null, party, sender, message);
 | 
			
		||||
        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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -48,7 +77,7 @@ public final class ChatAPI {
 | 
			
		||||
     * @param message The message to send
 | 
			
		||||
     */
 | 
			
		||||
    public static void sendAdminChat(Plugin plugin, String sender, String message) {
 | 
			
		||||
        ChatManager.handleAdminChat(plugin, sender, message);
 | 
			
		||||
        ChatManager.handleAdminChat(plugin, sender, sender, message);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -63,6 +92,6 @@ public final class ChatAPI {
 | 
			
		||||
     */
 | 
			
		||||
    @Deprecated
 | 
			
		||||
    public static void sendAdminChat(String sender, String message) {
 | 
			
		||||
        sendAdminChat(null, sender, message);
 | 
			
		||||
        sendAdminChat(null, sender, sender, message);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user