mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 20:46:41 +00:00
Keep on trying i guess.
Build has a critical error where sql data is being interpreted incorrectly which is odd considering no sql changes were made.
This commit is contained in:
@ -18,23 +18,19 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class Hierarchy
|
||||
{
|
||||
private static final Hierarchy hierarchy = new Hierarchy(); // static singleton for global state.
|
||||
private final GroupWrapper groupWrapper;
|
||||
private final TrackWrapper trackWrapper;
|
||||
private final UserWrapper userWrapper;
|
||||
private final PlayerAdapter<Player> playerAdapter;
|
||||
private final GroupProvider groupProvider;
|
||||
|
||||
private Hierarchy()
|
||||
public Hierarchy()
|
||||
{
|
||||
this.playerAdapter = TotalFreedomMod.getPlugin().lpb.getAPI().getPlayerAdapter(Player.class);
|
||||
this.groupWrapper = new GroupWrapper(TotalFreedomMod.getPlugin().lpb.getAPI().getGroupManager());
|
||||
this.trackWrapper = new TrackWrapper(TotalFreedomMod.getPlugin().lpb.getAPI().getTrackManager());
|
||||
this.userWrapper = new UserWrapper(TotalFreedomMod.getPlugin().lpb.getAPI().getUserManager(), getPlayerAdapter());
|
||||
}
|
||||
|
||||
public static Hierarchy getHierarchy()
|
||||
{
|
||||
return hierarchy;
|
||||
this.groupProvider = new GroupProvider();
|
||||
}
|
||||
|
||||
public TrackWrapper tw()
|
||||
@ -62,16 +58,17 @@ public class Hierarchy
|
||||
User user = uw().getUser(player);
|
||||
return user
|
||||
.getNodes(NodeType.INHERITANCE)
|
||||
.contains(GroupProvider
|
||||
.inheritanceNode(
|
||||
GroupProvider
|
||||
.ADMIN
|
||||
.getGroup()));
|
||||
.contains(groups().inheritanceNode(groups().getAdmin()));
|
||||
}
|
||||
|
||||
public GroupProvider groups()
|
||||
{
|
||||
return groupProvider;
|
||||
}
|
||||
|
||||
public Track op()
|
||||
{
|
||||
return tw().getTrack("OP");
|
||||
return tw().getTrack("op");
|
||||
}
|
||||
|
||||
public Track builder()
|
||||
@ -81,7 +78,7 @@ public class Hierarchy
|
||||
|
||||
public Track admin()
|
||||
{
|
||||
return tw().getTrack("ADMIN");
|
||||
return tw().getTrack("admin");
|
||||
}
|
||||
|
||||
public void asyncInheritFrom(DisplayableGroup inherited, DisplayableGroup inheritor)
|
||||
@ -92,8 +89,8 @@ public class Hierarchy
|
||||
.add(inherited.getInheritance());
|
||||
|
||||
gw().saveGroup(inheritor
|
||||
.getLuckPermsGroup()
|
||||
.getName());
|
||||
.getLuckPermsGroup()
|
||||
.getName());
|
||||
|
||||
FLog.info("Inherited " + inherited.getName() + " to " + inheritor.getName());
|
||||
}
|
||||
@ -138,10 +135,13 @@ public class Hierarchy
|
||||
for (String group : track.getGroups())
|
||||
{
|
||||
Group g = gw().getGroup(group);
|
||||
InheritanceNode node = GroupProvider.directFromLPG(g).getInheritance();
|
||||
InheritanceNode node = groups()
|
||||
.fromLuckPerms(g)
|
||||
.getInheritance();
|
||||
|
||||
if (user.getNodes(NodeType.INHERITANCE).contains(node))
|
||||
uw().removeFromGroup(user, GroupProvider.wrappedFromLPG(g).getGroup());
|
||||
uw().removeFromGroup(user, groups()
|
||||
.fromLuckPerms(g));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user