cn.nukkit.permission.BanList Java Examples
The following examples show how to use
cn.nukkit.permission.BanList.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BanListCommand.java From Jupiter with GNU General Public License v3.0 | 4 votes |
@Override public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!this.testPermission(sender)) { return true; } BanList list; boolean ips = false; if (args.length > 0) { switch (args[0].toLowerCase()) { case "ips": list = sender.getServer().getIPBans(); ips = true; break; case "players": list = sender.getServer().getNameBans(); break; default: sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage)); return false; } } else { list = sender.getServer().getNameBans(); } StringBuilder builder = new StringBuilder(); Iterator<BanEntry> itr = list.getEntires().values().iterator(); while (itr.hasNext()) { builder.append(itr.next().getName()); if (itr.hasNext()) { builder.append(", "); } } if (ips) { sender.sendMessage(new TranslationContainer("commands.banlist.ips", String.valueOf(list.getEntires().size()))); } else { sender.sendMessage(new TranslationContainer("commands.banlist.players", String.valueOf(list.getEntires().size()))); } sender.sendMessage(builder.toString()); return true; }
Example #2
Source File: Server.java From Nukkit with GNU General Public License v3.0 | 4 votes |
public BanList getNameBans() { return this.banByName; }
Example #3
Source File: Server.java From Nukkit with GNU General Public License v3.0 | 4 votes |
public BanList getIPBans() { return this.banByIP; }
Example #4
Source File: BanListCommand.java From Nukkit with GNU General Public License v3.0 | 4 votes |
@Override public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!this.testPermission(sender)) { return true; } BanList list; boolean ips = false; if (args.length > 0) { switch (args[0].toLowerCase()) { case "ips": list = sender.getServer().getIPBans(); ips = true; break; case "players": list = sender.getServer().getNameBans(); break; default: sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage)); return false; } } else { list = sender.getServer().getNameBans(); } StringBuilder builder = new StringBuilder(); Iterator<BanEntry> itr = list.getEntires().values().iterator(); while (itr.hasNext()) { builder.append(itr.next().getName()); if (itr.hasNext()) { builder.append(", "); } } if (ips) { sender.sendMessage(new TranslationContainer("commands.banlist.ips", String.valueOf(list.getEntires().size()))); } else { sender.sendMessage(new TranslationContainer("commands.banlist.players", String.valueOf(list.getEntires().size()))); } sender.sendMessage(builder.toString()); return true; }
Example #5
Source File: Server.java From Nukkit with GNU General Public License v3.0 | 4 votes |
public BanList getNameBans() { return this.banByName; }
Example #6
Source File: Server.java From Nukkit with GNU General Public License v3.0 | 4 votes |
public BanList getIPBans() { return this.banByIP; }
Example #7
Source File: BanListCommand.java From Nukkit with GNU General Public License v3.0 | 4 votes |
@Override public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!this.testPermission(sender)) { return true; } BanList list; boolean ips = false; if (args.length > 0) { switch (args[0].toLowerCase()) { case "ips": list = sender.getServer().getIPBans(); ips = true; break; case "players": list = sender.getServer().getNameBans(); break; default: sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage)); return false; } } else { list = sender.getServer().getNameBans(); } StringBuilder builder = new StringBuilder(); Iterator<BanEntry> itr = list.getEntires().values().iterator(); while (itr.hasNext()) { builder.append(itr.next().getName()); if (itr.hasNext()) { builder.append(", "); } } if (ips) { sender.sendMessage(new TranslationContainer("commands.banlist.ips", String.valueOf(list.getEntires().size()))); } else { sender.sendMessage(new TranslationContainer("commands.banlist.players", String.valueOf(list.getEntires().size()))); } sender.sendMessage(builder.toString()); return true; }
Example #8
Source File: Server.java From Jupiter with GNU General Public License v3.0 | 2 votes |
/** * 名前Banされた人のリストを取得します。 * @return BanList 名前Banリスト */ public BanList getNameBans() { return this.banByName; }
Example #9
Source File: Server.java From Jupiter with GNU General Public License v3.0 | 2 votes |
/** * IPBanされた人のリストを取得します。 * @return BanList IPBanリスト */ public BanList getIPBans() { return this.banByIP; }