示例#1
0
 public Map<String, String> getEpDBSettings() {
   Map<String, String> epSettings = new HashMap<String, String>();
   epSettings.put("protect.datatype", config.getString("protect.datatype", "sqlite"));
   epSettings.put("protect.username", config.getString("protect.username", "root"));
   epSettings.put("protect.password", config.getString("protect.password", "root"));
   epSettings.put(
       "protect.mysqlDb",
       config.getString("protect.mysqlDb", "jdbc:mysql://localhost:3306/minecraft"));
   return epSettings;
 }
示例#2
0
 public final String getUserByAddress(final String search) {
   final List<String> usernames = users.getKeys(null);
   for (String username : usernames) {
     final String address = users.getString(username + "." + ADDRESS, null);
     if (address != null && search.equalsIgnoreCase(address)) {
       return username;
     }
   }
   return null;
 }
示例#3
0
  public ChatColor getOperatorColor() throws Exception {
    String colorName = config.getString("ops-name-color", null);

    if (colorName == null) return ChatColor.RED;
    if ("none".equalsIgnoreCase(colorName) || colorName.isEmpty()) throw new Exception();

    try {
      return ChatColor.valueOf(colorName.toUpperCase());
    } catch (IllegalArgumentException ex) {
    }

    return ChatColor.getByCode(Integer.parseInt(colorName, 16));
  }
示例#4
0
 public List<Integer> epBlockBreakingBlacklist() {
   final List<Integer> epBreakList = new ArrayList<Integer>();
   for (String itemName : config.getString("protect.blacklist.break", "").split(",")) {
     itemName = itemName.trim();
     if (itemName.isEmpty()) {
       continue;
     }
     ItemStack is;
     try {
       is = ItemDb.get(itemName);
       epBreakList.add(is.getTypeId());
     } catch (Exception ex) {
       logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, "blacklist.break"));
     }
   }
   return epBreakList;
 }
示例#5
0
 public List<Integer> getEpAlertOnUse() {
   final List<Integer> epAlertUse = new ArrayList<Integer>();
   for (String itemName : config.getString("protect.alert.on-use", "").split(",")) {
     itemName = itemName.trim();
     if (itemName.isEmpty()) {
       continue;
     }
     ItemStack is;
     try {
       is = ItemDb.get(itemName);
       epAlertUse.add(is.getTypeId());
     } catch (Exception ex) {
       logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, "alert.on-use"));
     }
   }
   return epAlertUse;
 }
示例#6
0
 public List<Integer> itemSpawnBlacklist() {
   final List<Integer> epItemSpwn = new ArrayList<Integer>();
   for (String itemName : config.getString("item-spawn-blacklist", "").split(",")) {
     itemName = itemName.trim();
     if (itemName.isEmpty()) {
       continue;
     }
     ItemStack is;
     try {
       is = ItemDb.get(itemName);
       epItemSpwn.add(is.getTypeId());
     } catch (Exception ex) {
       logger.log(
           Level.SEVERE, Util.format("unknownItemInList", itemName, "item-spawn-blacklist"));
     }
   }
   return epItemSpwn;
 }
示例#7
0
 public String getCurrencySymbol() {
   return config.getString("currency-symbol", "$").substring(0, 1).replaceAll("[0-9]", "$");
 }
示例#8
0
 public String getLocale() {
   return config.getString("locale", "");
 }
示例#9
0
	private String _getLastLoginAddress()
	{
		return config.getString("ipAddress", "");
	}
示例#10
0
	private String _getJail()
	{
		return config.getString("jail");
	}
示例#11
0
 public String getChatFormat(String group) {
   return config.getString(
       "chat.group-formats." + (group == null ? "Default" : group),
       config.getString("chat.format", "&7[{GROUP}]&f {DISPLAYNAME}&7:&f {MESSAGE}"));
 }
示例#12
0
 public String getBackupCommand() {
   return config.getString("backup.command", null);
 }
示例#13
0
 public String getNetherName() {
   return config.getString("nether.folder", "nether");
 }
示例#14
0
 public String getNicknamePrefix() {
   return config.getString("nickname-prefix", "~");
 }
示例#15
0
 public String getCommandPrefix() {
   return config.getString("command-prefix", "");
 }
示例#16
0
 public boolean getAnnounceNewPlayers() {
   return !config.getString("newbies.announce-format", "-").isEmpty();
 }
示例#17
0
	public String _getNickname()
	{
		return config.getString("nickname");
	}
示例#18
0
 public String getAnnounceNewPlayerFormat(IUser user) {
   return format(
       config.getString("newbies.announce-format", "&dWelcome {DISPLAYNAME} to the server!"),
       user);
 }
示例#19
0
	public String getBanReason()
	{
		return config.getString("ban.reason", "");
	}
示例#20
0
 public String getNewbieSpawn() {
   return config.getString("newbies.spawnpoint", "default");
 }
示例#21
0
	private String _getGeoLocation()
	{
		return config.getString("geolocation");
	}
示例#22
0
 public final String getAddress(final String username) {
   return users.getString(username.toLowerCase() + "." + ADDRESS, null);
 }