mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-24 11:44:24 +00:00
Cleanup sponge files and don't persist empty sections - resolves #96
This commit is contained in:
1 file changed
+9
-3
+9
-3
@@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user