aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason Penilla <[email protected]>2024-05-20 11:15:21 -0700
committerGitHub <[email protected]>2024-05-20 11:15:21 -0700
commit9bf48555241dc03246c67258fe66eaf6c7a4a044 (patch)
treea468f2a1f5ad0ffcc3dd7f111dfea6da35a59ee7
parent7d2e5c33ead3f4040597b2200f00fbd0e5b1e502 (diff)
downloadPaper-9bf48555241dc03246c67258fe66eaf6c7a4a044.tar.gz
Paper-9bf48555241dc03246c67258fe66eaf6c7a4a044.zip
Add a better warning message than "Server performance will be affected" for CommandRegisteredEvent use (#10754)
-rw-r--r--patches/api/0476-Brigadier-based-command-API.patch6
1 files changed, 4 insertions, 2 deletions
diff --git a/patches/api/0476-Brigadier-based-command-API.patch b/patches/api/0476-Brigadier-based-command-API.patch
index 911d9fb384..02c42eb273 100644
--- a/patches/api/0476-Brigadier-based-command-API.patch
+++ b/patches/api/0476-Brigadier-based-command-API.patch
@@ -270,16 +270,17 @@ index 0000000000000000000000000000000000000000..6ac205de582983863bd5b3c0fa70d437
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/brigadier/CommandRegisteredEvent.java b/src/main/java/com/destroystokyo/paper/event/brigadier/CommandRegisteredEvent.java
new file mode 100644
-index 0000000000000000000000000000000000000000..8a0c7266cc3fe63d3c6fd83bcd75c54de21038b4
+index 0000000000000000000000000000000000000000..d195c76d9343d2e9e6ade5318ae00470e5c0fe34
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/brigadier/CommandRegisteredEvent.java
-@@ -0,0 +1,169 @@
+@@ -0,0 +1,171 @@
+package com.destroystokyo.paper.event.brigadier;
+
+import com.destroystokyo.paper.brigadier.BukkitBrigadierCommand;
+import com.mojang.brigadier.tree.ArgumentCommandNode;
+import com.mojang.brigadier.tree.LiteralCommandNode;
+import com.mojang.brigadier.tree.RootCommandNode;
++import org.bukkit.Warning;
+import org.bukkit.command.Command;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
@@ -299,6 +300,7 @@ index 0000000000000000000000000000000000000000..8a0c7266cc3fe63d3c6fd83bcd75c54d
+ */
+@Deprecated(since = "1.20.6")
++@Warning(reason = "This event has been superseded by the Commands API and will be removed in a future release. Listen to LifecycleEvents.COMMANDS instead.")
+public class CommandRegisteredEvent<S extends com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource> extends ServerEvent implements Cancellable {
+
+ private static final HandlerList handlers = new HandlerList();