From 4055139dcd982aa9d69958eee0ecb2aa8a6eee30 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 1 Feb 2013 21:45:06 +1100 Subject: [PATCH] Don't create new sections for each player. --- .../src/main/java/net/md_5/bungee/config/YamlConfig.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java index 7f676993..43eff1a9 100644 --- a/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java @@ -96,7 +96,7 @@ public class YamlConfig implements ConfigurationAdapter if (index == -1) { Object val = submap.get(path); - if (val == null) + if (val == null && def != null) { val = def; submap.put(path, def); @@ -193,8 +193,8 @@ public class YamlConfig implements ConfigurationAdapter @SuppressWarnings("unchecked") public Collection getGroups(String player) { - Collection groups = get("groups." + player, Collections.EMPTY_LIST); - Collection ret = new HashSet<>(groups); + Collection groups = get("groups." + player, null); + Collection ret = (groups == null) ? new HashSet() : new HashSet<>(groups); ret.add("default"); return ret; } @@ -203,6 +203,6 @@ public class YamlConfig implements ConfigurationAdapter @SuppressWarnings("unchecked") public Collection getPermissions(String group) { - return get("permissions." + group, Collections.EMPTY_SET); + return get("permissions." + group, Collections.EMPTY_LIST); } }