Expose server CommandMap

This commit is contained in:
Riley Park 2016-02-15 07:11:57 -08:00
parent cb4c48c343
commit 8b42b27076
2 changed files with 88 additions and 0 deletions

View file

@ -0,0 +1,67 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Riley Park <rileysebastianpark@gmail.com>
Date: Mon, 15 Feb 2016 07:11:17 -0800
Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ import java.util.logging.Logger;
import org.bukkit.Warning.WarningState;
import org.bukkit.command.CommandException;
+import org.bukkit.command.CommandMap;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.command.PluginCommand;
@@ -0,0 +0,0 @@ public final class Bukkit {
return server.getUnsafe();
}
+ // Paper start
+ /**
+ * Gets the active {@link CommandMap}.
+ *
+ * @return the active command map
+ */
+ public static CommandMap getCommandMap() {
+ return server.getCommandMap();
+ }
+ // Paper end
+
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ import java.util.logging.Logger;
import org.bukkit.Warning.WarningState;
import org.bukkit.command.CommandException;
+import org.bukkit.command.CommandMap;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.command.PluginCommand;
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
@Deprecated
UnsafeValues getUnsafe();
+ // Paper start
+ /**
+ * Gets the active {@link CommandMap}.
+ *
+ * @return the active command map
+ */
+ CommandMap getCommandMap();
+ // Paper end
+
public class Spigot
{
@Deprecated
--
2.7.0.rc0.20.g4b9ab0e

View file

@ -0,0 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Riley Park <rileysebastianpark@gmail.com>
Date: Mon, 15 Feb 2016 07:11:28 -0800
Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
return helpMap;
}
+ @Override // Paper - add override
public SimpleCommandMap getCommandMap() {
return commandMap;
}
--
2.7.0.rc0.20.g4b9ab0e