Pulling all pending Bukkit-JavaDoc changes
A special thanks goes to @aerouk for almost all of the changes found here.
This commit is contained in:
@@ -8,14 +8,20 @@ import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* This event will sometimes fire synchronously, depending on how it was triggered.
|
||||
* The constructor provides a boolean to indicate if the event was fired synchronously or asynchronously.
|
||||
* When asynchronous, this event can be called from any thread, but the main thread, and has limited access to the API.<br>
|
||||
* <br>
|
||||
* If a player is the direct cause of this event by incoming packet, this event will be asynchronous.
|
||||
* If a plugin triggers this event by compelling a player to chat, this event will be synchronous.<br>
|
||||
* <br>
|
||||
* <b>Care should be taken to check {@link #isAsynchronous()} and treat the event appropriately.</b>
|
||||
* This event will sometimes fire synchronously, depending on how it was
|
||||
* triggered.
|
||||
* <p>
|
||||
* The constructor provides a boolean to indicate if the event was fired
|
||||
* synchronously or asynchronously. When asynchronous, this event can be
|
||||
* called from any thread, but the main thread, and has limited access to the
|
||||
* API.
|
||||
* <p>
|
||||
* If a player is the direct cause of this event by incoming packet, this
|
||||
* event will be asynchronous. If a plugin triggers this event by compelling a
|
||||
* player to chat, this event will be synchronous.
|
||||
* <p>
|
||||
* Care should be taken to check {@link #isAsynchronous()} and treat the event
|
||||
* appropriately.
|
||||
*/
|
||||
public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@@ -29,7 +35,8 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable {
|
||||
* @param async This changes the event to a synchronous state.
|
||||
* @param who the chat sender
|
||||
* @param message the message sent
|
||||
* @param players the players to receive the message. This may be a lazy or unmodifiable collection.
|
||||
* @param players the players to receive the message. This may be a lazy
|
||||
* or unmodifiable collection.
|
||||
*/
|
||||
public AsyncPlayerChatEvent(final boolean async, final Player who, final String message, final Set<Player> players) {
|
||||
super(who, async);
|
||||
@@ -38,7 +45,8 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the message that the player is attempting to send. This message will be used with {@link #getFormat()}.
|
||||
* Gets the message that the player is attempting to send. This message
|
||||
* will be used with {@link #getFormat()}.
|
||||
*
|
||||
* @return Message the player is attempting to send
|
||||
*/
|
||||
@@ -47,7 +55,8 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the message that the player will send. This message will be used with {@link #getFormat()}.
|
||||
* Sets the message that the player will send. This message will be used
|
||||
* with {@link #getFormat()}.
|
||||
*
|
||||
* @param message New message that the player will send
|
||||
*/
|
||||
@@ -57,9 +66,13 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
/**
|
||||
* Gets the format to use to display this chat message.
|
||||
* When this event finishes execution, the first format parameter is the {@link Player#getDisplayName()} and the second parameter is {@link #getMessage()}
|
||||
* <p>
|
||||
* When this event finishes execution, the first format parameter is the
|
||||
* {@link Player#getDisplayName()} and the second parameter is {@link
|
||||
* #getMessage()}
|
||||
*
|
||||
* @return {@link String#format(String, Object...)} compatible format string
|
||||
* @return {@link String#format(String, Object...)} compatible format
|
||||
* string
|
||||
*/
|
||||
public String getFormat() {
|
||||
return format;
|
||||
@@ -67,10 +80,15 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
/**
|
||||
* Sets the format to use to display this chat message.
|
||||
* When this event finishes execution, the first format parameter is the {@link Player#getDisplayName()} and the second parameter is {@link #getMessage()}
|
||||
* <p>
|
||||
* When this event finishes execution, the first format parameter is the
|
||||
* {@link Player#getDisplayName()} and the second parameter is {@link
|
||||
* #getMessage()}
|
||||
*
|
||||
* @param format {@link String#format(String, Object...)} compatible format string
|
||||
* @throws IllegalFormatException if the underlying API throws the exception
|
||||
* @param format {@link String#format(String, Object...)} compatible
|
||||
* format string
|
||||
* @throws IllegalFormatException if the underlying API throws the
|
||||
* exception
|
||||
* @throws NullPointerException if format is null
|
||||
* @see String#format(String, Object...)
|
||||
*/
|
||||
@@ -88,10 +106,14 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
/**
|
||||
* Gets a set of recipients that this chat message will be displayed to.
|
||||
* The set returned is not guaranteed to be mutable and may auto-populate on access.
|
||||
* Any listener accessing the returned set should be aware that it may reduce performance for a lazy set implementation.<br>
|
||||
* <br>
|
||||
* <b>Listeners should be aware that modifying the list may throw {@link UnsupportedOperationException} if the event caller provides an unmodifiable set.</b>
|
||||
* <p>
|
||||
* The set returned is not guaranteed to be mutable and may auto-populate
|
||||
* on access. Any listener accessing the returned set should be aware that
|
||||
* it may reduce performance for a lazy set implementation.
|
||||
* <p>
|
||||
* Listeners should be aware that modifying the list may throw {@link
|
||||
* UnsupportedOperationException} if the event caller provides an
|
||||
* unmodifiable set.
|
||||
*
|
||||
* @return All Players who will see this chat message
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user