Files
Bukkit/src/main/java/org/bukkit/event/player/PlayerEvent.java
Wesley Wolfe e49a640760 BREAKING: replace defunct PlayerChatEvent with async chat. Addresses BUKKIT-2064
PlayerChatEvent is now Deprecated. It should be fired asynchronously, but
has not been so traditionally. To do so would massively break plugins that
rely on it.

AsyncPlayerChatEvent now replaces PlayerChatEvent. It uses comparable
functionality, but can be fired without synchronizing to the event manager.
The event will sometimes fire synchronously if triggered by a plugin.

Because PlayerChatEvent is now deprecated, PlayerCommandPreprocessEvent will
no longer extend PlayerChatEvent. This is almost completely source and
binary compatible, bar plugins that downcast to PlayerChatEvent.
Additionally, some methods that are non-functional have been marked
deprecated and indicate such.

Additionally, new constructors are now provided to allow for lazier
initialization of the receiving player set. A note has been added stating
plugins should be prepared for UnsupportedOperationExceptions if the caller
provides an unmodifiable collection.
2012-08-03 20:31:01 -05:00

31 lines
592 B
Java

package org.bukkit.event.player;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
/**
* Represents a player related event
*/
public abstract class PlayerEvent extends Event {
protected Player player;
public PlayerEvent(final Player who) {
player = who;
}
PlayerEvent(final Player who, boolean async) {
super(async);
player = who;
}
/**
* Returns the player involved in this event
*
* @return Player who is involved in this event
*/
public final Player getPlayer() {
return player;
}
}