diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/command/SimpleCommandMap.java | 4 | ||||
-rw-r--r-- | src/main/java/org/bukkit/plugin/java/JavaPlugin.java | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java index a0dd292f..3f651de3 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -3,7 +3,6 @@ package org.bukkit.command; import static org.bukkit.util.Java15Compat.Arrays_copyOfRange; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -101,7 +100,8 @@ public class SimpleCommandMap implements CommandMap { * {@inheritDoc} */ public boolean register(String label, String fallbackPrefix, Command command) { - label = label.toLowerCase(); + label = label.toLowerCase().trim(); + fallbackPrefix = fallbackPrefix.toLowerCase().trim(); boolean registered = register(label, command, false); knownCommands.put(fallbackPrefix + ":" + label, command); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java index d1c3321c..a0b609fa 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java @@ -351,11 +351,11 @@ public abstract class JavaPlugin extends PluginBase { String alias = name.toLowerCase(); PluginCommand command = getServer().getPluginCommand(alias); - if ((command != null) && (command.getPlugin() != this)) { + if (command == null || command.getPlugin() != this) { command = getServer().getPluginCommand(description.getName().toLowerCase() + ":" + alias); } - if ((command != null) && (command.getPlugin() == this)) { + if (command != null && command.getPlugin() == this) { return command; } else { return null; |