本文整理汇总了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);
}
}
}