From 1b7a66b41ad42422b7963f69729c443b141972c2 Mon Sep 17 00:00:00 2001 From: Luck Date: Sun, 4 Dec 2016 23:09:12 +0000 Subject: [PATCH] Fix #66 --- .../java/me/lucko/luckperms/sponge/model/SpongeGroup.java | 4 ++-- .../java/me/lucko/luckperms/sponge/model/SpongeUser.java | 4 ++-- .../luckperms/sponge/service/LuckPermsSubjectData.java | 8 +++----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeGroup.java b/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeGroup.java index 450fc084..e6bd9c8f 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeGroup.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeGroup.java @@ -76,8 +76,8 @@ public class SpongeGroup extends Group { private GroupSubject(LPSpongePlugin plugin, SpongeGroup parent) { this.parent = parent; this.plugin = plugin; - this.subjectData = new LuckPermsSubjectData(true, plugin.getService(), parent); - this.transientSubjectData = new LuckPermsSubjectData(false, plugin.getService(), parent); + this.subjectData = new LuckPermsSubjectData(true, plugin.getService(), parent, this); + this.transientSubjectData = new LuckPermsSubjectData(false, plugin.getService(), parent, this); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeUser.java b/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeUser.java index 3609d399..7c7da46d 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeUser.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeUser.java @@ -77,8 +77,8 @@ public class SpongeUser extends User { private UserSubject(LPSpongePlugin plugin, SpongeUser parent) { this.parent = parent; this.plugin = plugin; - this.subjectData = new LuckPermsSubjectData(true, plugin.getService(), parent); - this.transientSubjectData = new LuckPermsSubjectData(false, plugin.getService(), parent); + this.subjectData = new LuckPermsSubjectData(true, plugin.getService(), parent, this); + this.transientSubjectData = new LuckPermsSubjectData(false, plugin.getService(), parent, this); } private boolean hasData() { diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java index 7be49f98..278eb1f2 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java @@ -69,6 +69,9 @@ public class LuckPermsSubjectData implements LPSubjectData { @Getter private final PermissionHolder holder; + @Getter + LPSubject parentSubject; + private void objectSave(PermissionHolder t) { if (t instanceof User) { service.getPlugin().getStorage().saveUser(((User) t)) @@ -80,11 +83,6 @@ public class LuckPermsSubjectData implements LPSubjectData { } } - @Override - public LPSubject getParentSubject() { - return null; - } - @Override public Map> getPermissions() { try (Timing ignored = service.getPlugin().getTimings().time(LPTiming.LP_SUBJECT_GET_PERMISSIONS)) {