Cleanup & multiple small fixes
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
package me.lucko.luckperms.groups;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import me.lucko.luckperms.LuckPermsPlugin;
|
||||
import me.lucko.luckperms.utils.PermissionObject;
|
||||
|
||||
@ToString(of = {"name"})
|
||||
@EqualsAndHashCode(of = {"name"}, callSuper = false)
|
||||
public class Group extends PermissionObject {
|
||||
|
||||
/**
|
||||
@@ -13,7 +17,7 @@ public class Group extends PermissionObject {
|
||||
private final String name;
|
||||
|
||||
Group(String name, LuckPermsPlugin plugin) {
|
||||
super(plugin, name);
|
||||
super(name, plugin);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@@ -23,9 +27,4 @@ public class Group extends PermissionObject {
|
||||
public void clearNodes() {
|
||||
getNodes().clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package me.lucko.luckperms.groups;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.lucko.luckperms.LuckPermsPlugin;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class GroupManager {
|
||||
private final LuckPermsPlugin plugin;
|
||||
|
||||
@@ -15,10 +17,6 @@ public class GroupManager {
|
||||
@Getter
|
||||
private final Map<String, Group> groups = new ConcurrentHashMap<>();
|
||||
|
||||
public GroupManager(LuckPermsPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a group object by name
|
||||
* @param name The name to search by
|
||||
@@ -75,19 +73,6 @@ public class GroupManager {
|
||||
groups.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load all groups from the datastore
|
||||
*/
|
||||
public void loadAllGroups() {
|
||||
plugin.getDatastore().loadAllGroups(success -> {
|
||||
String defaultGroup = plugin.getConfiguration().getDefaultGroupName();
|
||||
|
||||
if (!groups.keySet().contains(defaultGroup)) {
|
||||
plugin.getDatastore().createAndLoadGroup(defaultGroup, success1 -> {});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a new group object
|
||||
* @param name The name of the group
|
||||
|
||||
Reference in New Issue
Block a user