✨ Add a ManagerSetting to override existing commands
This commit is contained in:
parent
1ff5a2c4ce
commit
ded94567c6
3 changed files with 15 additions and 1 deletions
|
|
@ -24,6 +24,7 @@
|
|||
package cloud.commandframework.bukkit;
|
||||
|
||||
import cloud.commandframework.Command;
|
||||
import cloud.commandframework.CommandManager;
|
||||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.arguments.StaticArgument;
|
||||
import cloud.commandframework.internal.CommandRegistrationHandler;
|
||||
|
|
@ -89,6 +90,11 @@ public class BukkitPluginRegistrationHandler<C> implements CommandRegistrationHa
|
|||
this.bukkitCommandManager
|
||||
);
|
||||
|
||||
if (this.bukkitCommandManager.getSetting(CommandManager.ManagerSettings.OVERRIDE_EXISTING_COMMANDS)) {
|
||||
this.bukkitCommands.remove(label);
|
||||
aliases.forEach(alias -> this.bukkitCommands.remove(alias));
|
||||
}
|
||||
|
||||
for (final String alias : aliases) {
|
||||
final String namespacedAlias = this.getNamespacedLabel(alias);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue