this.permissionsFile = new File(baseDir, permissionFilename);
addSchemaUpdate(new SchemaUpdate(1) {
@Override
public void performUpdate() {
ConfigurationSection userSection = permissions.getConfigurationSection("users");
if (userSection != null) {
for (Map.Entry<String, Object> e : userSection.getValues(false).entrySet()) {
if (e.getValue() instanceof ConfigurationSection) {
allWorlds((ConfigurationSection) e.getValue());
}
}
}
ConfigurationSection groupSection = permissions.getConfigurationSection("groups");
if (groupSection != null) {
for (Map.Entry<String, Object> e : groupSection.getValues(false).entrySet()) {
if (e.getValue() instanceof ConfigurationSection) {
allWorlds((ConfigurationSection) e.getValue());
}
}
}
}
private void allWorlds(ConfigurationSection section) {
singleWorld(section);
ConfigurationSection worldSection = section.getConfigurationSection("worlds");
if (worldSection != null) {
for (Map.Entry<String, Object> e : worldSection.getValues(false).entrySet()) {
if (e.getValue() instanceof ConfigurationSection) {
singleWorld((ConfigurationSection) e.getValue());
}
}
}