Archiviert
1
0

Hotfix SWCommand

Dieser Commit ist enthalten in:
yoyosource 2022-06-16 22:27:45 +02:00
Ursprung 6192fd98c7
Commit c6a68fa2a1
2 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen

@ -1 +1 @@
Subproject commit b183ce0b2dadc9143d8eb9c5f1aeba2a8ea78d32 Subproject commit b1328695a1a30c062d066ff564a9112fde668b3e

Datei anzeigen

@ -58,14 +58,17 @@ public class SWCommand extends AbstractSWCommand<CommandSender> {
protected SWCommand(String command, String permission, String... aliases) { protected SWCommand(String command, String permission, String... aliases) {
super(CommandSender.class, command, aliases); super(CommandSender.class, command, aliases);
this.permission = permission; this.permission = permission;
create = true;
createAndSafeCommand(command, aliases); createAndSafeCommand(command, aliases);
unregister(); unregister();
register(); register();
} }
private boolean create = false;
@Override @Override
protected void createAndSafeCommand(String command, String[] aliases) { protected void createAndSafeCommand(String command, String[] aliases) {
if (permission == null) return; if (!create) return;
this.command = new TabCompletableCommand(command, permission, aliases) { this.command = new TabCompletableCommand(command, permission, aliases) {
@Override @Override
public void execute(CommandSender commandSender, String[] strings) { public void execute(CommandSender commandSender, String[] strings) {