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.
31 lines
592 B
Java
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;
|
|
}
|
|
}
|