From a61d3b3fd4c9f1ada3cd38606fdcec15d23bd7a5 Mon Sep 17 00:00:00 2001 From: Luck Date: Sun, 29 Jan 2017 21:56:09 +0000 Subject: [PATCH] Fix sponge PEX/PM migration issue with defaults --- .../java/me/lucko/luckperms/common/core/model/User.java | 7 +++++++ .../sponge/migration/MigrationPermissionManager.java | 3 +++ .../luckperms/sponge/migration/MigrationPermissionsEx.java | 3 +++ 3 files changed, 13 insertions(+) diff --git a/common/src/main/java/me/lucko/luckperms/common/core/model/User.java b/common/src/main/java/me/lucko/luckperms/common/core/model/User.java index 6fe1f022..06460a37 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/model/User.java +++ b/common/src/main/java/me/lucko/luckperms/common/core/model/User.java @@ -152,6 +152,13 @@ public class User extends PermissionHolder implements Identifiable { // 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); diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java index e90b239f..a377b6a1 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java @@ -153,6 +153,9 @@ public class MigrationPermissionsEx extends SubCommand { // 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);