🐛 Fix Bukkit alias command suggestions without Brigadier
This commit is contained in:
parent
e6af4e6caa
commit
dbdafed273
4 changed files with 35 additions and 26 deletions
|
|
@ -88,6 +88,29 @@ public class BukkitPluginRegistrationHandler<C> implements CommandRegistrationHa
|
|||
(CommandArgument<C, ?>) commandArgument,
|
||||
this.bukkitCommandManager
|
||||
);
|
||||
|
||||
for (final String alias : aliases) {
|
||||
this.recognizedAliases.add(getNamespacedLabel(alias));
|
||||
if (!this.bukkitCommands.containsKey(alias)) {
|
||||
this.recognizedAliases.add(alias);
|
||||
if (this.bukkitCommandManager.getSplitAliases()) {
|
||||
@SuppressWarnings("unchecked") final BukkitCommand<C> aliasCommand = new BukkitCommand<>(
|
||||
alias,
|
||||
Collections.emptyList(),
|
||||
(Command<C>) command,
|
||||
(CommandArgument<C, ?>) commandArgument,
|
||||
this.bukkitCommandManager
|
||||
);
|
||||
this.commandMap.register(
|
||||
alias,
|
||||
this.bukkitCommandManager.getOwningPlugin().getName().toLowerCase(),
|
||||
bukkitCommand
|
||||
);
|
||||
this.registerExternal(alias, command, aliasCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.registeredCommands.put(commandArgument, bukkitCommand);
|
||||
if (!this.bukkitCommands.containsKey(label)) {
|
||||
this.recognizedAliases.add(label);
|
||||
|
|
@ -100,30 +123,6 @@ public class BukkitPluginRegistrationHandler<C> implements CommandRegistrationHa
|
|||
);
|
||||
this.registerExternal(label, command, bukkitCommand);
|
||||
|
||||
if (this.bukkitCommandManager.getSplitAliases()) {
|
||||
for (final String alias : aliases) {
|
||||
if (!this.bukkitCommands.containsKey(alias)) {
|
||||
@SuppressWarnings("unchecked") final BukkitCommand<C> aliasCommand = new BukkitCommand<>(
|
||||
alias,
|
||||
Collections.emptyList(),
|
||||
(Command<C>) command,
|
||||
(CommandArgument<C, ?>) commandArgument,
|
||||
this.bukkitCommandManager
|
||||
);
|
||||
if (!this.bukkitCommands.containsKey(alias)) {
|
||||
this.recognizedAliases.add(alias);
|
||||
}
|
||||
this.recognizedAliases.add(getNamespacedLabel(alias));
|
||||
this.commandMap.register(
|
||||
alias,
|
||||
this.bukkitCommandManager.getOwningPlugin().getName().toLowerCase(),
|
||||
bukkitCommand
|
||||
);
|
||||
this.registerExternal(alias, command, aliasCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -642,7 +642,7 @@ public final class MinecraftHelp<C> {
|
|||
* @param accent The color used for accents and symbols
|
||||
* @return A new {@link HelpColors} instance
|
||||
*/
|
||||
public static HelpColors of(
|
||||
public static @NonNull HelpColors of(
|
||||
final @NonNull TextColor primary,
|
||||
final @NonNull TextColor highlight,
|
||||
final @NonNull TextColor alternateHighlight,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue