Skip to content

Instantly share code, notes, and snippets.

@blablubbabc
Last active August 29, 2015 14:06
Show Gist options
  • Save blablubbabc/b044f06e5018b9ad4bf4 to your computer and use it in GitHub Desktop.
Save blablubbabc/b044f06e5018b9ad4bf4 to your computer and use it in GitHub Desktop.
package org.spongepowered.api.event.player;
import org.spongepowered.api.entity.Player;
/**
* Called when a {@link Player} sends a chat message
*/
public interface AsyncPlayerChatEvent extends PlayerEvent {
/**
* Get the message sent in this event
*
* @return The message sent
*/
String getMessage();
/**
* Sets the message sent in this event.
* Is used as fallback for players which are recipients of this chat event,
* but don't have a specific message set.
*
* @param message The new message for this chat event.
*/
void setMessage(String message);
/**
* Gets the recipients of this chat event
*
* @return The recipients of this chat event
*/
Set<Player> getRecipients();
/**
* Gets the message for a specific player.
* (If a player doesn't have a specific message set this could either return null,
* or return the fallback message of this event..)
*
* @return The message for a specific player
*/
String getMessage(Player player);
/**
* Sets the message for a specific player
*/
void setMessage(Player player);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment