From 0118c0bd79d81b972a3399a694f44097e42ea3f6 Mon Sep 17 00:00:00 2001 From: Jason <11360596+jpenilla@users.noreply.github.com> Date: Sun, 7 Aug 2022 13:47:43 -0700 Subject: [PATCH] Improve MojangAPI docs and replace @Deprecated with @ApiStatus.Experimental on draft APIs (#8261) --- .../AsyncPlayerSendCommandsEvent.java | 32 +++++++++++-------- .../AsyncPlayerSendSuggestionsEvent.java | 19 +++++++---- .../brigadier/CommandRegisteredEvent.java | 11 +++---- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendCommandsEvent.java b/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendCommandsEvent.java index d767aa23fe..495b0f0d2f 100644 --- a/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendCommandsEvent.java +++ b/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendCommandsEvent.java @@ -3,33 +3,33 @@ package com.destroystokyo.paper.event.brigadier; import com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource; import com.mojang.brigadier.tree.RootCommandNode; import org.bukkit.Bukkit; -import org.bukkit.Warning; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; /** * Fired any time a Brigadier RootCommandNode is generated for a player to inform the client of commands. * You may manipulate this CommandNode to change what the client sees. * - * This event may fire on login, world change, and permission rebuilds, by plugin request, and potentially future means. + *
This event may fire on login, world change, and permission rebuilds, by plugin request, and potentially future means.
* - * This event will fire before {@link org.bukkit.event.player.PlayerCommandSendEvent}, so no filtering has been done by - * other plugins yet. + *This event will fire before {@link org.bukkit.event.player.PlayerCommandSendEvent}, so no filtering has been done by + * other plugins yet.
* - * WARNING: This event will potentially (and most likely) fire twice! Once for Async, and once again for Sync. + *WARNING: This event will potentially (and most likely) fire twice! Once for Async, and once again for Sync. * It is important that you check event.isAsynchronous() and event.hasFiredAsync() to ensure you only act once. - * If for some reason we are unable to send this asynchronously in the future, only the sync method will fire. + * If for some reason we are unable to send this asynchronously in the future, only the sync method will fire.
* - * Your logic should look like this: - * if (event.isAsynchronous() || !event.hasFiredAsync()) { do stuff } + *Your logic should look like this: + * {@code if (event.isAsynchronous() || !event.hasFiredAsync()) { // do stuff }}
* - * If your logic is not safe to run asynchronously, only react to the synchronous version. - * @deprecated Draft API - Subject to change until confirmed solves desired use cases + *If your logic is not safe to run asynchronously, only react to the synchronous version.
+ * + *This is a draft/experimental API and is subject to change.
*/ -@Deprecated -@Warning(false) +@ApiStatus.Experimental public class AsyncPlayerSendCommandsEventAllows a plugin to control the command node structure for its commands. * This is done at Plugin Enable time after commands have been registered, but may also - * run at a later point in the server lifetime due to plugins, a server reload, etc. + * run at a later point in the server lifetime due to plugins, a server reload, etc.
* - * @deprecated Draft API - Subject to change until confirmed solves desired use cases + *This is a draft/experimental API and is subject to change.
*/ -@Deprecated -@Warning(false) +@ApiStatus.Experimental public class CommandRegisteredEvent