testserver/patches/api/0018-Expose-server-CommandM...

51 lines
1.6 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Mon, 29 Feb 2016 19:48:59 -0600
Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 362b879996623832d436bb987630b115b7d86f99..5345e05755b13553491211a84d263c80ce347adf 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2060,6 +2060,19 @@ public final class Bukkit {
2021-06-11 12:02:28 +00:00
return server.getUnsafe();
}
+
+ // Paper start
+ /**
+ * Gets the active {@link org.bukkit.command.CommandMap}
+ *
+ * @return the active command map
+ */
+ @NotNull
+ public static org.bukkit.command.CommandMap getCommandMap() {
+ return server.getCommandMap();
+ }
+ // Paper end
+
@NotNull
public static Server.Spigot spigot() {
return server.spigot();
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 8dda96966061bb3a12b63fff74a378857ec43200..aca9050075f3041e2b248368e378c354e7b553d6 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1602,6 +1602,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
2021-06-11 12:02:28 +00:00
public double[] getTPS();
// Paper end
+ // Paper start
+ /**
+ * Gets the active {@link org.bukkit.command.CommandMap}
+ *
+ * @return the active command map
+ */
+ @NotNull
+ org.bukkit.command.CommandMap getCommandMap();
+
/**
* Get the advancement specified by this key.
*