mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-28 03:57:36 +01:00
Fix exporting users not in the default group
This commit is contained in:
parent
56df2477ca
commit
80d2246634
@ -127,14 +127,24 @@ public class ExportCommand extends SingleMainCommand {
|
||||
plugin.getDatastore().loadUser(uuid, "null");
|
||||
User user = plugin.getUserManager().get(uuid);
|
||||
|
||||
boolean inDefault = false;
|
||||
for (Node node : user.getNodes()) {
|
||||
if (node.isGroupNode() && node.getGroupName().equalsIgnoreCase("default")) {
|
||||
inDefault = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
write(writer, nodeToString(node, user.getUuid().toString(), false));
|
||||
}
|
||||
|
||||
if (!user.getPrimaryGroup().equalsIgnoreCase("default")) {
|
||||
write(writer, "/luckperms user " + user.getUuid().toString() + " setprimarygroup " + user.getPrimaryGroup());
|
||||
}
|
||||
|
||||
if (!inDefault) {
|
||||
write(writer, "/luckperms user " + user.getUuid().toString() + " removegroup default");
|
||||
}
|
||||
|
||||
plugin.getUserManager().cleanup(user);
|
||||
}
|
||||
log.info("Export: Exported " + userCount + " users.");
|
||||
|
@ -24,11 +24,13 @@ package me.lucko.luckperms.contexts;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@ToString
|
||||
@AllArgsConstructor
|
||||
public class Contexts {
|
||||
public static Contexts allowAll() {
|
||||
|
Loading…
Reference in New Issue
Block a user