本文整理汇总了Java中org.bukkit.BanList.Type方法的典型用法代码示例。如果您正苦于以下问题:Java BanList.Type方法的具体用法?Java BanList.Type怎么用?Java BanList.Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.BanList
的用法示例。
在下文中一共展示了BanList.Type方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBanList
import org.bukkit.BanList; //导入方法依赖的package包/类
@Override
public BanList getBanList(BanList.Type type){
Validate.notNull(type, "Type cannot be null");
switch(type){
case IP:
return new CraftIpBanList(playerList.getBannedIPs());
case NAME:
default:
return new CraftProfileBanList(playerList.func_152608_h());
}
}
示例2: execute
import org.bukkit.BanList; //导入方法依赖的package包/类
@Override
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
if (!testPermission(sender)) return true;
BanList.Type banType = BanList.Type.NAME;
if (args.length > 0) {
if (args[0].equalsIgnoreCase("ips")) {
banType = BanList.Type.IP;
} else if (!args[0].equalsIgnoreCase("players")) {
sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
return false;
}
}
StringBuilder message = new StringBuilder();
BanEntry[] banlist = Bukkit.getBanList(banType).getBanEntries().toArray(new BanEntry[0]);
for (int x = 0; x < banlist.length; x++) {
if (x != 0) {
if (x == banlist.length - 1) {
message.append(" and ");
} else {
message.append(", ");
}
}
message.append(banlist[x].getTarget());
}
sender.sendMessage("There are " + banlist.length + " total banned players:");
sender.sendMessage(message.toString());
return true;
}
示例3: getBanList
import org.bukkit.BanList; //导入方法依赖的package包/类
@Override
public BanList getBanList(BanList.Type type) {
Validate.notNull(type, "Type cannot be null");
switch(type){
case IP:
return new CraftIpBanList(playerList.getIPBans());
case NAME:
default:
return new CraftProfileBanList(playerList.getProfileBans());
}
}
示例4: getBanList
import org.bukkit.BanList; //导入方法依赖的package包/类
@Override
public BanList getBanList(BanList.Type type) {
switch (type) {
case NAME:
return profileBans;
case IP:
return ipBans;
default:
return null;
}
}
示例5: getBanType
import org.bukkit.BanList; //导入方法依赖的package包/类
/**
* @return the ban type;
*/
public BanList.Type getBanType() {
return banType;
}
示例6: getBanList
import org.bukkit.BanList; //导入方法依赖的package包/类
public BanList getBanList(BanList.Type type) {
Preconditions.checkNotNull(type, "type");
return new CanaryBanList(Canary.bans(), type);
}
示例7: getBanList
import org.bukkit.BanList; //导入方法依赖的package包/类
@Override
public BanList getBanList(BanList.Type arg0) {
return null;
}
示例8: getBanList
import org.bukkit.BanList; //导入方法依赖的package包/类
public static BanList getBanList(BanList.Type type) {
return null;
}
示例9: getBanList
import org.bukkit.BanList; //导入方法依赖的package包/类
BanList getBanList(BanList.Type type);