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.
This commit is contained in:
Wesley Wolfe
2012-08-03 06:15:12 -05:00
parent 0b2870a6fd
commit e49a640760
4 changed files with 242 additions and 4 deletions

View File

@@ -13,6 +13,12 @@ public abstract class PlayerEvent extends Event {
player = who;
}
PlayerEvent(final Player who, boolean async) {
super(async);
player = who;
}
/**
* Returns the player involved in this event
*