当前位置: 首页>>代码示例>>Java>>正文


Java IPBanEntry类代码示例

本文整理汇总了Java中net.minecraft.server.management.IPBanEntry的典型用法代码示例。如果您正苦于以下问题:Java IPBanEntry类的具体用法?Java IPBanEntry怎么用?Java IPBanEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IPBanEntry类属于net.minecraft.server.management包,在下文中一共展示了IPBanEntry类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addBan

import net.minecraft.server.management.IPBanEntry; //导入依赖的package包/类
@Override
public org.bukkit.BanEntry addBan(String target, String reason, Date expires, String source) {
    Validate.notNull(target, "Ban target cannot be null");

    IPBanEntry entry = new IPBanEntry(target, new Date(),
            StringUtils.isBlank(source) ? null : source, expires,
            StringUtils.isBlank(reason) ? null : reason);

    list.func_152687_a(entry);

    try {
        list.func_152678_f();
    } catch (IOException ex) {
        MinecraftServer.getLogger().error("Failed to save banned-ips.json, " + ex.getMessage());
    }

    return new CraftIpBanEntry(target, entry, list);
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:19,代码来源:CraftIpBanList.java

示例2: func_147210_a

import net.minecraft.server.management.IPBanEntry; //导入依赖的package包/类
protected void func_147210_a(ICommandSender p_147210_1_, String p_147210_2_, String p_147210_3_)
{
    IPBanEntry ipbanentry = new IPBanEntry(p_147210_2_, (Date)null, p_147210_1_.getName(), (Date)null, p_147210_3_);
    MinecraftServer.getServer().getConfigurationManager().getBannedIPs().addEntry(ipbanentry);
    List<EntityPlayerMP> list = MinecraftServer.getServer().getConfigurationManager().getPlayersMatchingAddress(p_147210_2_);
    String[] astring = new String[list.size()];
    int i = 0;

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

    if (list.isEmpty())
    {
        notifyOperators(p_147210_1_, this, "commands.banip.success", new Object[] {p_147210_2_});
    }
    else
    {
        notifyOperators(p_147210_1_, this, "commands.banip.success.players", new Object[] {p_147210_2_, joinNiceString(astring)});
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:CommandBanIp.java

示例3: func_147210_a

import net.minecraft.server.management.IPBanEntry; //导入依赖的package包/类
protected void func_147210_a(ICommandSender p_147210_1_, String p_147210_2_, String p_147210_3_)
{
    IPBanEntry ipbanentry = new IPBanEntry(p_147210_2_, (Date)null, p_147210_1_.getCommandSenderName(), (Date)null, p_147210_3_);
    MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152687_a(ipbanentry);
    List list = MinecraftServer.getServer().getConfigurationManager().getPlayerList(p_147210_2_);
    String[] astring = new String[list.size()];
    int i = 0;
    EntityPlayerMP entityplayermp;

    for (Iterator iterator = list.iterator(); iterator.hasNext(); astring[i++] = entityplayermp.getCommandSenderName())
    {
        entityplayermp = (EntityPlayerMP)iterator.next();
        entityplayermp.playerNetServerHandler.kickPlayerFromServer("You have been IP banned.");
    }

    if (list.isEmpty())
    {
        func_152373_a(p_147210_1_, this, "commands.banip.success", new Object[] {p_147210_2_});
    }
    else
    {
        func_152373_a(p_147210_1_, this, "commands.banip.success.players", new Object[] {p_147210_2_, joinNiceString(astring)});
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:25,代码来源:CommandBanIp.java

示例4: CraftIpBanEntry

import net.minecraft.server.management.IPBanEntry; //导入依赖的package包/类
public CraftIpBanEntry(String target, IPBanEntry entry, BanList list) {
    this.list = list;
    this.target = target;
    this.created = entry.getCreated() != null ? new Date(entry.getCreated().getTime()) : null;
    this.source = entry.getSource();
    this.expiration = entry.getBanEndDate() != null ? new Date(entry.getBanEndDate().getTime()) : null;
    this.reason = entry.getBanReason();
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:9,代码来源:CraftIpBanEntry.java

示例5: save

import net.minecraft.server.management.IPBanEntry; //导入依赖的package包/类
@Override
public void save() {
    IPBanEntry entry = new IPBanEntry(target, this.created, this.source, this.expiration, this.reason);
    this.list.func_152687_a(entry);
    try {
        this.list.func_152678_f();
    } catch (IOException ex) {
        MinecraftServer.getLogger().error("Failed to save banned-ips.json, " + ex.getMessage());
    }
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:11,代码来源:CraftIpBanEntry.java

示例6: getBanEntry

import net.minecraft.server.management.IPBanEntry; //导入依赖的package包/类
@Override
public org.bukkit.BanEntry getBanEntry(String target) {
    Validate.notNull(target, "Target cannot be null");

    IPBanEntry entry = (IPBanEntry) list.func_152683_b(target);
    if (entry == null) {
        return null;
    }

    return new CraftIpBanEntry(target, entry, list);
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:12,代码来源:CraftIpBanList.java

示例7: getBanEntries

import net.minecraft.server.management.IPBanEntry; //导入依赖的package包/类
@Override
public Set<org.bukkit.BanEntry> getBanEntries() {
    ImmutableSet.Builder<org.bukkit.BanEntry> builder = ImmutableSet.builder();
    for (String target : list.func_152685_a()) {
        builder.add(new CraftIpBanEntry(target, (IPBanEntry) list.func_152683_b(target), list));
    }

    return builder.build();
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:10,代码来源:CraftIpBanList.java


注:本文中的net.minecraft.server.management.IPBanEntry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。