public static String[] getMapNames(FileConfiguration fileConfiguration) { String[] names = new String[getConfigMapsCount(fileConfiguration)]; if (ConfigFactory.getKeysUnderPath("settings.maps", false, fileConfiguration) != null) { ConfigFactory.getKeysUnderPath("settings.maps", false, fileConfiguration).toArray(names); } return names; }
public static int getConfigMapsCount(FileConfiguration fileConfiguration) { int n = 0; if (ConfigFactory.getKeysUnderPath("settings.maps", false, fileConfiguration) == null) { return 0; } n = ConfigFactory.getKeysUnderPath("settings.maps", false, fileConfiguration).size(); return n; }