From 6875ad8bb890376913d9141b955c996444fbe94c Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 10 Aug 2018 08:20:07 +1000 Subject: Update documentation and status of command completion related events --- .../java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java | 5 +++++ src/main/java/org/bukkit/event/player/PlayerCommandSendEvent.java | 5 ----- src/main/java/org/bukkit/event/server/TabCompleteEvent.java | 7 +++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java b/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java index 7241a9b4..44cc0518 100644 --- a/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java @@ -3,12 +3,17 @@ package org.bukkit.event.player; import java.util.Collection; import org.apache.commons.lang.Validate; +import org.bukkit.Warning; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; /** * Called when a player attempts to tab-complete a chat message. + * + * @deprecated This event is no longer fired due to client changes */ +@Deprecated +@Warning(reason = "This event is no longer fired due to client changes") public class PlayerChatTabCompleteEvent extends PlayerEvent { private static final HandlerList handlers = new HandlerList(); private final String message; diff --git a/src/main/java/org/bukkit/event/player/PlayerCommandSendEvent.java b/src/main/java/org/bukkit/event/player/PlayerCommandSendEvent.java index fbdecdcc..6ab24ba4 100644 --- a/src/main/java/org/bukkit/event/player/PlayerCommandSendEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerCommandSendEvent.java @@ -1,7 +1,6 @@ package org.bukkit.event.player; import java.util.Collection; -import org.bukkit.Warning; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; @@ -13,11 +12,7 @@ import org.bukkit.event.HandlerList; * are not required to securely remove all traces of the command. If secure * removal of commands is required, then the command should be assigned a * permission which is not granted to the player. - * - * @deprecated draft API */ -@Deprecated -@Warning(false) public class PlayerCommandSendEvent extends PlayerEvent { private static final HandlerList handlers = new HandlerList(); diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java index 6ac437d5..a6229839 100644 --- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java +++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java @@ -6,10 +6,17 @@ import org.bukkit.command.CommandSender; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerCommandSendEvent; /** * Called when a {@link CommandSender} of any description (ie: player or * console) attempts to tab complete. + *
+ * Note that due to client changes, if the sender is a Player, this event will + * only begin to fire once command arguments are specified, not commands + * 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}. */ public class TabCompleteEvent extends Event implements Cancellable { -- cgit v1.2.3