diff options
author | Jake Potrebic <[email protected]> | 2023-12-28 16:50:06 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2023-12-28 16:50:06 -0800 |
commit | e4ab50de34bfdc2faa2cbb64e0c276d7ff38ccdc (patch) | |
tree | b1e9fd6e84a351feac0e77a1f9c04647615eaa89 /patches/api/0006-Adventure.patch | |
parent | 2951732742d5f5d5af761fb934a2ed35bf1c7e07 (diff) | |
download | Paper-e4ab50de34bfdc2faa2cbb64e0c276d7ff38ccdc.tar.gz Paper-e4ab50de34bfdc2faa2cbb64e0c276d7ff38ccdc.zip |
Properly disallow async Player#chat (#8123)
Clarify asynchronous status of AsyncChatEvent
Diffstat (limited to 'patches/api/0006-Adventure.patch')
-rw-r--r-- | patches/api/0006-Adventure.patch | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/patches/api/0006-Adventure.patch b/patches/api/0006-Adventure.patch index a1e01fd4cc..d0d3c58a65 100644 --- a/patches/api/0006-Adventure.patch +++ b/patches/api/0006-Adventure.patch @@ -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(); |