Java 类net.minecraft.server.management.UserListIPBansEntry 实例源码

项目:Backmemed    文件:CommandBanIp.java   
protected void banIp(MinecraftServer server, ICommandSender sender, String ipAddress, @Nullable String banReason)
{
    UserListIPBansEntry userlistipbansentry = new UserListIPBansEntry(ipAddress, (Date)null, sender.getName(), (Date)null, banReason);
    server.getPlayerList().getBannedIPs().addEntry(userlistipbansentry);
    List<EntityPlayerMP> list = server.getPlayerList().getPlayersMatchingAddress(ipAddress);
    String[] astring = new String[list.size()];
    int i = 0;

    for (EntityPlayerMP entityplayermp : list)
    {
        entityplayermp.connection.kickPlayerFromServer("You have been IP banned.");
        astring[i++] = entityplayermp.getName();
    }

    if (list.isEmpty())
    {
        notifyCommandListener(sender, this, "commands.banip.success", new Object[] {ipAddress});
    }
    else
    {
        notifyCommandListener(sender, this, "commands.banip.success.players", new Object[] {ipAddress, joinNiceString(astring)});
    }
}
项目:CustomWorldGen    文件:CommandBanIp.java   
protected void banIp(MinecraftServer server, ICommandSender sender, String ipAddress, @Nullable String banReason)
{
    UserListIPBansEntry userlistipbansentry = new UserListIPBansEntry(ipAddress, (Date)null, sender.getName(), (Date)null, banReason);
    server.getPlayerList().getBannedIPs().addEntry(userlistipbansentry);
    List<EntityPlayerMP> list = server.getPlayerList().getPlayersMatchingAddress(ipAddress);
    String[] astring = new String[list.size()];
    int i = 0;

    for (EntityPlayerMP entityplayermp : list)
    {
        entityplayermp.connection.kickPlayerFromServer("You have been IP banned.");
        astring[i++] = entityplayermp.getName();
    }

    if (list.isEmpty())
    {
        notifyCommandListener(sender, this, "commands.banip.success", new Object[] {ipAddress});
    }
    else
    {
        notifyCommandListener(sender, this, "commands.banip.success.players", new Object[] {ipAddress, joinNiceString(astring)});
    }
}
项目:ExpandedRailsMod    文件:CommandBanIp.java   
protected void banIp(MinecraftServer server, ICommandSender sender, String ipAddress, @Nullable String banReason)
{
    UserListIPBansEntry userlistipbansentry = new UserListIPBansEntry(ipAddress, (Date)null, sender.getName(), (Date)null, banReason);
    server.getPlayerList().getBannedIPs().addEntry(userlistipbansentry);
    List<EntityPlayerMP> list = server.getPlayerList().getPlayersMatchingAddress(ipAddress);
    String[] astring = new String[list.size()];
    int i = 0;

    for (EntityPlayerMP entityplayermp : list)
    {
        entityplayermp.connection.kickPlayerFromServer("You have been IP banned.");
        astring[i++] = entityplayermp.getName();
    }

    if (list.isEmpty())
    {
        notifyCommandListener(sender, this, "commands.banip.success", new Object[] {ipAddress});
    }
    else
    {
        notifyCommandListener(sender, this, "commands.banip.success.players", new Object[] {ipAddress, joinNiceString(astring)});
    }
}