diff --git a/src/com/sk89q/worldguard/protection/databases/YAMLDatabase.java b/src/com/sk89q/worldguard/protection/databases/YAMLDatabase.java index 8a763da4..a80e41e8 100644 --- a/src/com/sk89q/worldguard/protection/databases/YAMLDatabase.java +++ b/src/com/sk89q/worldguard/protection/databases/YAMLDatabase.java @@ -25,6 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.logging.Logger; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.BlockVector2D; @@ -216,11 +217,26 @@ private void addMarshalledFlag(Map flagData, private Map getDomainData(DefaultDomain domain) { Map domainData = new HashMap(); - domainData.put("players", domain.getPlayers()); - domainData.put("groups", domain.getGroups()); + setDomainData(domainData, "players", domain.getPlayers()); + setDomainData(domainData, "groups", domain.getGroups()); return domainData; } + + private void setDomainData(Map domainData, + String key, Set domain) { + if (domain.size() == 0) { + return; + } + + List list = new ArrayList(); + + for (String str : domain) { + list.add(str); + } + + domainData.put(key, list); + } @Override public Map getRegions() { diff --git a/src/com/sk89q/worldguard/util/yaml/Configuration.java b/src/com/sk89q/worldguard/util/yaml/Configuration.java index 1bcaa6db..706287f8 100644 --- a/src/com/sk89q/worldguard/util/yaml/Configuration.java +++ b/src/com/sk89q/worldguard/util/yaml/Configuration.java @@ -75,8 +75,8 @@ public Configuration(File file) { super(new HashMap()); DumperOptions options = new DumperOptions(); - options.setIndent(4); - options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); + options.setIndent(2); + options.setDefaultFlowStyle(DumperOptions.FlowStyle.AUTO); yaml = new Yaml(new SafeConstructor(), new Representer(), options); diff --git a/src/com/sk89q/worldguard/util/yaml/ConfigurationNode.java b/src/com/sk89q/worldguard/util/yaml/ConfigurationNode.java index 3ee00a06..265e9a23 100644 --- a/src/com/sk89q/worldguard/util/yaml/ConfigurationNode.java +++ b/src/com/sk89q/worldguard/util/yaml/ConfigurationNode.java @@ -158,9 +158,9 @@ public void setProperty(String path, Object value) { * @return */ public ConfigurationNode addNode(String path) { - ConfigurationNode node = new ConfigurationNode( - new HashMap()); - setProperty(path, node); + Map map = new HashMap(); + ConfigurationNode node = new ConfigurationNode(map); + setProperty(path, map); return node; }