SteamWar/BungeeCore
Archiviert
13
2

Hotfix SWCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-06-16 22:18:44 +02:00
Ursprung c97233b68b
Commit 059a945867

Datei anzeigen

@ -54,15 +54,22 @@ public class SWCommand extends AbstractSWCommand<CommandSender> {
protected SWCommand(String command, String permission) {
super(CommandSender.class, command);
this.permission = permission;
createAndSafeCommand(command, new String[0]);
unregister();
register();
}
protected SWCommand(String command, String permission, String... aliases) {
super(CommandSender.class, command, aliases);
this.permission = permission;
createAndSafeCommand(command, aliases);
unregister();
register();
}
@Override
protected void createAndSafeCommand(String command, String[] aliases) {
if (permission == null) return;
this.command = new TabCompletableCommand(command, permission, aliases) {
@Override
public void execute(CommandSender commandSender, String[] strings) {
@ -84,11 +91,13 @@ public class SWCommand extends AbstractSWCommand<CommandSender> {
@Override
public void unregister() {
if (command == null) return;
CommandRegistering.unregister(this.command);
}
@Override
public void register() {
if (command == null) return;
CommandRegistering.register(this.command);
}