mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 11:38:40 +01:00
Cleanup sponge files and don't persist empty sections - resolves #96
This commit is contained in:
parent
0ae59bd3e6
commit
fc4750706b
@ -47,17 +47,23 @@ public class SubjectDataHolder {
|
||||
public SubjectDataHolder(Map<ImmutableContextSet, Map<String, String>> options, Map<ImmutableContextSet, Map<String, Boolean>> permissions, Map<ImmutableContextSet, Set<SubjectReference>> parents) {
|
||||
this.options = new HashMap<>();
|
||||
for (Map.Entry<ImmutableContextSet, Map<String, String>> e : options.entrySet()) {
|
||||
this.options.put(e.getKey().toMap(), new HashMap<>(e.getValue()));
|
||||
if (!e.getValue().isEmpty()) {
|
||||
this.options.put(e.getKey().toMap(), new HashMap<>(e.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
this.permissions = new HashMap<>();
|
||||
for (Map.Entry<ImmutableContextSet, Map<String, Boolean>> e : permissions.entrySet()) {
|
||||
this.permissions.put(e.getKey().toMap(), new HashMap<>(e.getValue()));
|
||||
if (!e.getValue().isEmpty()) {
|
||||
this.permissions.put(e.getKey().toMap(), new HashMap<>(e.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
this.parents = new HashMap<>();
|
||||
for (Map.Entry<ImmutableContextSet, Set<SubjectReference>> e : parents.entrySet()) {
|
||||
this.parents.put(e.getKey().toMap(), e.getValue().stream().map(SubjectReference::serialize).collect(Collectors.toList()));
|
||||
if (!e.getValue().isEmpty()) {
|
||||
this.parents.put(e.getKey().toMap(), e.getValue().stream().map(SubjectReference::serialize).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user