summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authort00thpick1 <t00thpick1dirko@gmail.com>2014-02-09 12:27:08 -0500
committert00thpick1 <t00thpick1dirko@gmail.com>2014-02-09 19:25:46 -0500
commit4c35c61ca913b7fcee89a7444218c923d9b37ab1 (patch)
tree67b682056f321bf194b938027698bcf1b0a8c606 /src
parent8fb03c1da74c0be411b80e66931abad5090af023 (diff)
downloadbukkit-4c35c61ca913b7fcee89a7444218c923d9b37ab1.tar
bukkit-4c35c61ca913b7fcee89a7444218c923d9b37ab1.tar.gz
bukkit-4c35c61ca913b7fcee89a7444218c923d9b37ab1.tar.lz
bukkit-4c35c61ca913b7fcee89a7444218c923d9b37ab1.tar.xz
bukkit-4c35c61ca913b7fcee89a7444218c923d9b37ab1.zip
[Bleeding] Fix getCommand for conflicting plugin commands.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/command/SimpleCommandMap.java4
-rw-r--r--src/main/java/org/bukkit/plugin/java/JavaPlugin.java4
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;