Skip to content

Instantly share code, notes, and snippets.

@blablubbabc
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save blablubbabc/b044f06e5018b9ad4bf4 to your computer and use it in GitHub Desktop.

Select an option

Save blablubbabc/b044f06e5018b9ad4bf4 to your computer and use it in GitHub Desktop.

Revisions

  1. blablubbabc revised this gist Sep 14, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -18,8 +18,10 @@ public interface AsyncPlayerChatEvent extends PlayerEvent {
    * 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();
    void setMessage(String message);

    /**
    * Gets the recipients of this chat event
  2. blablubbabc revised this gist Sep 14, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ public interface AsyncPlayerChatEvent extends PlayerEvent {

    /**
    * Gets the message for a specific player.
    * (If a player doesn't have a specific message setm this could either return null,
    * (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
  3. blablubbabc revised this gist Sep 14, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,7 @@ public interface AsyncPlayerChatEvent extends PlayerEvent {
    *
    * @return The recipients of this chat event
    */
    Collection<Player> getRecipients();
    Set<Player> getRecipients();

    /**
    * Gets the message for a specific player.
  4. blablubbabc created this gist Sep 14, 2014.
    44 changes: 44 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    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.
    */
    void setMessage();

    /**
    * Gets the recipients of this chat event
    *
    * @return The recipients of this chat event
    */
    Collection<Player> getRecipients();

    /**
    * Gets the message for a specific player.
    * (If a player doesn't have a specific message setm 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);
    }