本文整理匯總了Java中org.bukkit.configuration.ConfigurationSection.getValues方法的典型用法代碼示例。如果您正苦於以下問題:Java ConfigurationSection.getValues方法的具體用法?Java ConfigurationSection.getValues怎麽用?Java ConfigurationSection.getValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.configuration.ConfigurationSection
的用法示例。
在下文中一共展示了ConfigurationSection.getValues方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: load
import org.bukkit.configuration.ConfigurationSection; //導入方法依賴的package包/類
public void load(File dataFolder, ConfigurationSection config) {
Path localRepositoryDirectory = Paths.get(config.getString("local_repository_directory"));
if (!localRepositoryDirectory.isAbsolute())
localRepositoryDirectory = dataFolder.toPath().resolve(localRepositoryDirectory);
setLocalRepositoryDirectory(localRepositoryDirectory.toFile());
ConfigurationSection repositories = config.getConfigurationSection("repositories");
if (repositories != null) {
Map<String, Object> entries = repositories.getValues(false);
List<RemoteRepository> resultRepositories = new ArrayList<>(entries.size());
for (Map.Entry<String, Object> entry : entries.entrySet())
resultRepositories.add(readRemoteRepository(entry.getKey(), (ConfigurationSection) entry.getValue()));
setRepositories(resultRepositories);
} else {
setRepositories(Collections.emptyList());
}
}
示例2: fetchPlayerById
import org.bukkit.configuration.ConfigurationSection; //導入方法依賴的package包/類
@Override
public HashMap<String, Object> fetchPlayerById(UUID id) {
ConfigurationSection section = config.getConfigurationSection("players." + id);
if (section == null)
return null;
return (HashMap<String, Object>) section.getValues(true);
}
示例3: fetchGroupByName
import org.bukkit.configuration.ConfigurationSection; //導入方法依賴的package包/類
@Override
public HashMap<String, Object> fetchGroupByName(String name) {
ConfigurationSection section = config.getConfigurationSection("groups." + name);
if (section == null)
return null;
return (HashMap<String, Object>) section.getValues(true);
}
示例4: getGroupList
import org.bukkit.configuration.ConfigurationSection; //導入方法依賴的package包/類
@Override
public HashMap<String, Object> getGroupList() {
ConfigurationSection section = config.getConfigurationSection("groups");
if (section == null)
return null;
return (HashMap<String, Object>) section.getValues(false);
}
示例5: removeUnusedValues
import org.bukkit.configuration.ConfigurationSection; //導入方法依賴的package包/類
private void removeUnusedValues(ConfigurationSection cs) {
Map<String, Object> objs = cs.getValues(false);
for (String key : objs.keySet()) {
if (cs.isConfigurationSection(key)) {
removeUnusedValues(cs.getConfigurationSection(key));
if (cs.getConfigurationSection(key) == null || cs.getConfigurationSection(key).getValues(false).isEmpty()) {
cs.set(key, null);
}
} else if (!defaultValues.containsKey(cs.getCurrentPath() + (cs.getCurrentPath().isEmpty() ? "" : ".") + key)) {
cs.set(key, null);
}
}
}