diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/persisted/SubjectDataHolder.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/persisted/SubjectDataHolder.java index b324efb63..23b80414b 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/persisted/SubjectDataHolder.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/persisted/SubjectDataHolder.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.sponge.service.persisted; +import com.google.common.base.Splitter; import lombok.ToString; import me.lucko.luckperms.api.context.ContextSet; import org.spongepowered.api.service.context.Context; @@ -41,7 +42,7 @@ import static me.lucko.luckperms.sponge.service.LuckPermsService.convertContexts public class SubjectDataHolder { private final Map, Map> permissions; private final Map, Map> options; - private final Map, List>> parents; + private final Map, List> parents; public SubjectDataHolder(Map, Map> options, Map, Map> permissions, Map, List>> parents) { this.options = new HashMap<>(); @@ -56,7 +57,7 @@ public class SubjectDataHolder { this.parents = new HashMap<>(); for (Map.Entry, List>> e : parents.entrySet()) { - this.parents.put(convertContexts(e.getKey()).toMap(), e.getValue().stream().map(p -> new AbstractMap.SimpleEntry<>(p.getKey(), p.getValue())).collect(Collectors.toList())); + this.parents.put(convertContexts(e.getKey()).toMap(), e.getValue().stream().map(p -> p.getKey() + "/" + p.getValue()).collect(Collectors.toList())); } } @@ -93,10 +94,11 @@ public class SubjectDataHolder { } } - for (Map.Entry, List>> e : parents.entrySet()) { + for (Map.Entry, List> e : parents.entrySet()) { Set contexts = convertContexts(ContextSet.fromMap(e.getKey())); - for (Map.Entry parent : e.getValue()) { - subjectData.addParent(contexts, service.getSubjects(parent.getKey()).get(parent.getValue())); + for (String parent : e.getValue()) { + List parts = Splitter.on('/').limit(2).splitToList(parent); + subjectData.addParent(contexts, service.getSubjects(parts.get(0)).get(parts.get(1))); } } }