geforkt von Mirrors/Paper
[Bleeding] Fix getCommand for conflicting plugin commands.
By: t00thpick1 <t00thpick1dirko@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
2c68d4b554
Commit
aecd846814
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren