2024-04-19 09:46:54 +08:00
|
|
|
package com.coloryr.allmusic.server.core.command;
|
2023-10-22 10:14:55 +08:00
|
|
|
|
2024-04-19 09:46:54 +08:00
|
|
|
import com.coloryr.allmusic.server.core.AllMusic;
|
2023-10-22 10:14:55 +08:00
|
|
|
|
2024-04-17 22:15:12 +08:00
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.List;
|
2023-10-22 10:14:55 +08:00
|
|
|
import java.util.Locale;
|
|
|
|
|
|
|
|
|
|
public class CommandBanPlayer implements ICommand {
|
|
|
|
|
@Override
|
2025-01-19 22:51:01 +08:00
|
|
|
public void execute(Object sender, String name, String[] args) {
|
2023-10-22 10:14:55 +08:00
|
|
|
if (args.length != 2) {
|
2024-04-17 22:15:12 +08:00
|
|
|
AllMusic.side.sendMessage(sender, AllMusic.getMessage().command.error);
|
2023-10-22 10:14:55 +08:00
|
|
|
return;
|
|
|
|
|
}
|
2024-04-17 22:15:12 +08:00
|
|
|
AllMusic.getConfig().addBanPlayer(args[1].toLowerCase(Locale.ROOT));
|
|
|
|
|
AllMusic.side.sendMessage(sender, "§d[AllMusic3]§2已禁止玩家" + args[1] + "点歌");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2025-03-09 21:24:18 +08:00
|
|
|
public List<String> tab(Object player, String name, String[] args, int index) {
|
2024-04-18 09:03:23 +08:00
|
|
|
if (args.length == index || (args.length == index + 1 && args[index].isEmpty())) {
|
2024-04-17 22:15:12 +08:00
|
|
|
return AllMusic.side.getPlayerList();
|
2023-10-22 10:14:55 +08:00
|
|
|
}
|
2024-04-17 22:15:12 +08:00
|
|
|
|
|
|
|
|
return Collections.emptyList();
|
2023-10-22 10:14:55 +08:00
|
|
|
}
|
|
|
|
|
}
|