Properly disallow async Player#chat (#8123)
Clarify asynchronous status of AsyncChatEvent
This commit is contained in:
parent
2951732742
commit
e4ab50de34
30 changed files with 78 additions and 65 deletions
|
@ -497,7 +497,7 @@ new file mode 100644
|
|||
index 0000000000000000000000000000000000000000..4eada40b8abb1833ce623ccee0789555e370d024
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/event/player/AsyncChatEvent.java
|
||||
@@ -0,0 +1,37 @@
|
||||
@@ -0,0 +1,47 @@
|
||||
+package io.papermc.paper.event.player;
|
||||
+
|
||||
+import java.util.Set;
|
||||
|
@ -512,6 +512,16 @@ index 0000000000000000000000000000000000000000..4eada40b8abb1833ce623ccee0789555
|
|||
+
|
||||
+/**
|
||||
+ * An event fired when a {@link Player} sends a chat message to the server.
|
||||
+ * <p>
|
||||
+ * This event will sometimes fire synchronously, depending on how it was
|
||||
+ * triggered.
|
||||
+ * <p>
|
||||
+ * If a player is the direct cause of this event by an 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 final class AsyncChatEvent extends AbstractChatEvent {
|
||||
+ private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue