Add primary groups
This commit is contained in:
@@ -26,6 +26,13 @@ public abstract class User extends PermissionObject {
|
||||
@Setter
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* The users primary group
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
private String primaryGroup = null;
|
||||
|
||||
User(UUID uuid, LuckPermsPlugin plugin) {
|
||||
super(plugin, uuid.toString());
|
||||
this.uuid = uuid;
|
||||
|
||||
@@ -57,7 +57,7 @@ public abstract class UserManager {
|
||||
* @param user The user to update or set
|
||||
*/
|
||||
public void updateOrSetUser(User user) {
|
||||
if (!users.containsKey(user.getUuid())) {
|
||||
if (!isLoaded(user.getUuid())) {
|
||||
// The user isn't already loaded, so we can just add
|
||||
users.put(user.getUuid(), user);
|
||||
// They're probably not online, but in case they are...
|
||||
@@ -65,6 +65,7 @@ public abstract class UserManager {
|
||||
} else {
|
||||
// Override the user's current loaded nodes, and force a refresh
|
||||
users.get(user.getUuid()).setNodes(user.getNodes());
|
||||
users.get(user.getUuid()).setPrimaryGroup(user.getPrimaryGroup());
|
||||
users.get(user.getUuid()).refreshPermissions();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user