Fix sponge PEX/PM migration issue with defaults
This commit is contained in:
parent
ab9284b80f
commit
a61d3b3fd4
@ -152,6 +152,13 @@ public class User extends PermissionHolder implements Identifiable<UserIdentifie
|
||||
getPlugin().getUserManager().giveDefaultIfNeeded(this, false);
|
||||
}
|
||||
|
||||
public void clearNodes(boolean giveDefault) {
|
||||
super.clearNodes();
|
||||
if (giveDefault) {
|
||||
getPlugin().getUserManager().giveDefaultIfNeeded(this, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
UserCache cache = userData;
|
||||
if (cache != null) {
|
||||
|
@ -127,6 +127,9 @@ public class MigrationPermissionManager extends SubCommand<Object> {
|
||||
// Make a LuckPerms user for the one being migrated
|
||||
plugin.getStorage().loadUser(uuid, "null").join();
|
||||
User user = plugin.getUserManager().get(uuid);
|
||||
if (user.getNodes().size() <= 1) {
|
||||
user.clearNodes(false);
|
||||
}
|
||||
migrateSubject(pmUser, user);
|
||||
plugin.getStorage().saveUser(user);
|
||||
plugin.getUserManager().cleanup(user);
|
||||
|
@ -153,6 +153,9 @@ public class MigrationPermissionsEx extends SubCommand<Object> {
|
||||
// Make a LuckPerms user for the one being migrated
|
||||
plugin.getStorage().loadUser(uuid, "null").join();
|
||||
User user = plugin.getUserManager().get(uuid);
|
||||
if (user.getNodes().size() <= 1) {
|
||||
user.clearNodes(false);
|
||||
}
|
||||
migrateSubject(pexUser, user);
|
||||
plugin.getStorage().saveUser(user);
|
||||
plugin.getUserManager().cleanup(user);
|
||||
|
Loading…
Reference in New Issue
Block a user