13
0
geforkt von Mirrors/Paper

[Bleeding] Fix getCommand for conflicting plugin commands.

By: t00thpick1 <t00thpick1dirko@gmail.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2014-02-09 12:27:08 -05:00
Ursprung 2c68d4b554
Commit aecd846814
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -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);

Datei anzeigen

@ -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;