mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-25 10:07:38 +01:00
Don't create new sections for each player.
This commit is contained in:
parent
be4a764932
commit
4055139dcd
@ -96,7 +96,7 @@ public class YamlConfig implements ConfigurationAdapter
|
|||||||
if (index == -1)
|
if (index == -1)
|
||||||
{
|
{
|
||||||
Object val = submap.get(path);
|
Object val = submap.get(path);
|
||||||
if (val == null)
|
if (val == null && def != null)
|
||||||
{
|
{
|
||||||
val = def;
|
val = def;
|
||||||
submap.put(path, def);
|
submap.put(path, def);
|
||||||
@ -193,8 +193,8 @@ public class YamlConfig implements ConfigurationAdapter
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Collection<String> getGroups(String player)
|
public Collection<String> getGroups(String player)
|
||||||
{
|
{
|
||||||
Collection<String> groups = get("groups." + player, Collections.EMPTY_LIST);
|
Collection<String> groups = get("groups." + player, null);
|
||||||
Collection<String> ret = new HashSet<>(groups);
|
Collection<String> ret = (groups == null) ? new HashSet<String>() : new HashSet<>(groups);
|
||||||
ret.add("default");
|
ret.add("default");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -203,6 +203,6 @@ public class YamlConfig implements ConfigurationAdapter
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Collection<String> getPermissions(String group)
|
public Collection<String> getPermissions(String group)
|
||||||
{
|
{
|
||||||
return get("permissions." + group, Collections.EMPTY_SET);
|
return get("permissions." + group, Collections.EMPTY_LIST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user