aboutsummaryrefslogtreecommitdiff
path: root/spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2019-08-03 22:04:20 +0100
committerLuck <git@lucko.me>2019-08-03 22:04:20 +0100
commit2a03b547c7714a130b2bc1407b12a8abd58a9069 (patch)
treec4306958d814964a58c472b959b94afda5ee3800 /spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java
parent4308eda6fd4ce3d637ad29b50f53d870ec1facbc (diff)
downloadspark-2a03b547c7714a130b2bc1407b12a8abd58a9069.tar.gz
spark-2a03b547c7714a130b2bc1407b12a8abd58a9069.tar.bz2
spark-2a03b547c7714a130b2bc1407b12a8abd58a9069.zip
Some more reorganising
Diffstat (limited to 'spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java')
-rw-r--r--spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java
index 66a1568..c65bc23 100644
--- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java
+++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/CommandMapUtil.java
@@ -44,7 +44,7 @@ import java.util.Map;
/**
* Utility for interacting with the server's {@link CommandMap} instance.
*/
-public final class CommandMapUtil {
+final class CommandMapUtil {
private static final Constructor<PluginCommand> COMMAND_CONSTRUCTOR;
private static final Field COMMAND_MAP_FIELD;
@@ -96,8 +96,11 @@ public final class CommandMapUtil {
PluginCommand cmd = COMMAND_CONSTRUCTOR.newInstance(alias, plugin);
getCommandMap().register(plugin.getDescription().getName(), cmd);
- getKnownCommandMap().put(plugin.getDescription().getName().toLowerCase() + ":" + alias.toLowerCase(), cmd);
- getKnownCommandMap().put(alias.toLowerCase(), cmd);
+
+ Map<String, Command> knownCommandMap = getKnownCommandMap();
+ knownCommandMap.put(plugin.getDescription().getName().toLowerCase() + ":" + alias.toLowerCase(), cmd);
+ knownCommandMap.put(alias.toLowerCase(), cmd);
+
cmd.setLabel(alias.toLowerCase());
cmd.setExecutor(command);