Fire TabCompleteEvent for legacy commands (#10834)

This commit is contained in:
Jake Potrebic 2024-05-31 08:46:42 -07:00 committed by GitHub
parent 3181470ad7
commit 0513374b1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 2 deletions

View file

@ -1974,3 +1974,16 @@ index 3ec32b46264cfff857b50129b5e0fa5584943ec6..bdfe68b386b5ca2878475e548d3c9a38
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Reload complete.");
return true;
diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
index b43c3cb5c88eada186d6f81712c244aaa18fb53e..ea26cb90d988d693f26e37229fbdee975c0b11f4 100644
--- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
+++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
@@ -18,6 +18,8 @@ import org.jetbrains.annotations.NotNull;
* themselves. Plugins wishing to remove commands from tab completion are
* advised to ensure the client does not have permission for the relevant
* commands, or use {@link PlayerCommandSendEvent}.
+ * @apiNote Only called for bukkit API commands {@link org.bukkit.command.Command} and
+ * {@link org.bukkit.command.CommandExecutor} and not for brigadier commands ({@link io.papermc.paper.command.brigadier.Commands}).
*/
public class TabCompleteEvent extends Event implements Cancellable {