anonymous No title
No License Java
2020年03月06日
Copy
public class Alts_Main implements CommandExecutor {

    public Alts_Main(){

    }


    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (args.length == 0) {

            sender.sendMessage(Main.prefix + "§c引数(player)を入力してください。");

        } else {


            OfflinePlayer op = Bukkit.getOfflinePlayer(args[0]);

            if (op != null && (op.hasPlayedBefore() || op.isOnline())) {

                List<String> alts_ = Alt_Check.getAltsByMCID(args[0]);
                List<String> addresses_ = Alt_Check.getAddressesByMCID(args[0]);
                List<String> hostnames_ = Alt_Check.getHostNamesByMCID(args[0]);

                BanList addressBans = getServer().getBanList(BanList.Type.IP);
                BanList nameBans = getServer().getBanList(BanList.Type.NAME);

                List<String> alts = new ArrayList<String>();
                List<String> addresses = new ArrayList<String>();
                List<String> hostnames = new ArrayList<String>();

                for (String alt : alts_) {

                    if (nameBans.isBanned(alt)) {

                        alts.add("§8- §c" + alt);

                    } else {

                        alts.add("§8- §a" + alt);
                    }
                }

                for (String address : addresses_) {

                    if (nameBans.isBanned(address)) {

                        addresses.add("§8- §c" + address);

                    } else {

                        addresses.add("§8- §a" + address);
                    }
                }

                for (String hostname : hostnames_) {

                    if (nameBans.isBanned(hostname)) {

                        hostnames.add("§8- §c" + hostname);

                    } else {

                        hostnames.add("§8- §a" + hostname);
                    }
                }
                sender.sendMessage("§3§l---------- §b§l" + args[0] + " §3§l----------");

                sender.sendMessage("§fAccount:");

                for (String alt : alts) {
                    sender.sendMessage(alt);
                }

                sender.sendMessage("§fIP:");

                for (String address : addresses) {
                    sender.sendMessage(address);
                }

                for (String hostname : hostnames) {
                    sender.sendMessage(hostname);
                }


                sender.sendMessage("§3§l-----------------------------------");

            } else {

                sender.sendMessage( Main.prefix + "§e" + args[0] + " §cはログインしたことがありません。");
            }
        }
        return true;
    }
}
public class Alts_Main implements CommandExecutor {

    public Alts_Main(){

    }


    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (args.length == 0) {

            sender.sendMessage(Main.prefix + "§c引数(player)を入力してください。");

        } else {


            OfflinePlayer op = Bukkit.getOfflinePlayer(args[0]);

            if (op != null && (op.hasPlayedBefore() || op.isOnline())) {

                List<String> alts_ = Alt_Check.getAltsByMCID(args[0]);
                List<String> addresses_ = Alt_Check.getAddressesByMCID(args[0]);
                List<String> hostnames_ = Alt_Check.getHostNamesByMCID(args[0]);

                BanList addressBans = getServer().getBanList(BanList.Type.IP);
                BanList nameBans = getServer().getBanList(BanList.Type.NAME);

                List<String> alts = new ArrayList<String>();
                List<String> addresses = new ArrayList<String>();
                List<String> hostnames = new ArrayList<String>();

                for (String alt : alts_) {

                    if (nameBans.isBanned(alt)) {

                        alts.add("§8- §c" + alt);

                    } else {

                        alts.add("§8- §a" + alt);
                    }
                }

                for (String address : addresses_) {

                    if (nameBans.isBanned(address)) {

                        addresses.add("§8- §c" + address);

                    } else {

                        addresses.add("§8- §a" + address);
                    }
                }

                for (String hostname : hostnames_) {

                    if (nameBans.isBanned(hostname)) {

                        hostnames.add("§8- §c" + hostname);

                    } else {

                        hostnames.add("§8- §a" + hostname);
                    }
                }
                sender.sendMessage("§3§l---------- §b§l" + args[0] + " §3§l----------");

                sender.sendMessage("§fAccount:");

                for (String alt : alts) {
                    sender.sendMessage(alt);
                }

                sender.sendMessage("§fIP:");

                for (String address : addresses) {
                    sender.sendMessage(address);
                }

                for (String hostname : hostnames) {
                    sender.sendMessage(hostname);
                }


                sender.sendMessage("§3§l-----------------------------------");

            } else {

                sender.sendMessage( Main.prefix + "§e" + args[0] + " §cはログインしたことがありません。");
            }
        }
        return true;
    }
}

年末年始は機械学習・深層学習を勉強しませんか?
No one still commented. Please first comment.
年末年始は機械学習・深層学習を勉強しませんか?
広告
未経験から最短でエンジニアへの転職を目指すなら