diff --git a/bukkit/src/main/java/me/lucko/luckperms/api/vault/VaultPermissionHook.java b/bukkit/src/main/java/me/lucko/luckperms/api/vault/VaultPermissionHook.java index da4225de..5fff6128 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/api/vault/VaultPermissionHook.java +++ b/bukkit/src/main/java/me/lucko/luckperms/api/vault/VaultPermissionHook.java @@ -234,6 +234,7 @@ public class VaultPermissionHook extends Permission implements Runnable { @Override public boolean playerAddGroup(String world, @NonNull String player, @NonNull String groupName) { + log("Adding player " + player + " to group: '" + groupName + "' on world " + world + ", server " + server); final User user = plugin.getUserManager().get(player); if (user == null) return false; @@ -241,7 +242,6 @@ public class VaultPermissionHook extends Permission implements Runnable { if (group == null) return false; scheduleTask(() -> { - log("Adding player " + player + " to group: '" + groupName + "' on world " + world + ", server " + server); // todo move try { if (world != null && !world.equals("")) { user.addGroup(group, server, world); @@ -256,6 +256,7 @@ public class VaultPermissionHook extends Permission implements Runnable { @Override public boolean playerRemoveGroup(String world, @NonNull String player, @NonNull String groupName) { + log("Removing player " + player + " from group: '" + groupName + "' on world " + world + ", server " + server); final User user = plugin.getUserManager().get(player); if (user == null) return false; @@ -263,8 +264,6 @@ public class VaultPermissionHook extends Permission implements Runnable { if (group == null) return false; scheduleTask(() -> { - log("Removing player " + player + " from group: '" + groupName + "' on world " + world + ", server " + server); // todo move - plugin.getLog().info("before: " + user.getNodes().toString()); try { if (world != null && !world.equals("")) { user.removeGroup(group, server, world); @@ -272,7 +271,6 @@ public class VaultPermissionHook extends Permission implements Runnable { user.removeGroup(group, server); } } catch (ObjectLacksException ignored) {} - plugin.getLog().info("after: " + user.getNodes().toString()); save(user); }); return true; diff --git a/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java b/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java index d24c8acd..bd334a81 100644 --- a/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java @@ -658,11 +658,11 @@ public abstract class PermissionHolder { } public static Map exportToLegacy(Set nodes) { - ImmutableMap.Builder m = ImmutableMap.builder(); + Map m = new HashMap<>(); for (Node node : nodes) { m.put(node.toSerializedNode(), node.getValue()); } - return m.build(); + return m; } private static Node.Builder buildNode(String permission) { diff --git a/common/src/main/java/me/lucko/luckperms/storage/methods/JSONDatastore.java b/common/src/main/java/me/lucko/luckperms/storage/methods/JSONDatastore.java index 9a3419cc..62b1aa6f 100644 --- a/common/src/main/java/me/lucko/luckperms/storage/methods/JSONDatastore.java +++ b/common/src/main/java/me/lucko/luckperms/storage/methods/JSONDatastore.java @@ -79,7 +79,6 @@ public class JSONDatastore extends FlatfileDatastore { public boolean loadUser(UUID uuid, String username) { User user = plugin.getUserManager().getOrMake(UserIdentifier.of(uuid, username)); user.getIoLock().lock(); - plugin.getLog().info("#loadUser for: " + user.getName()); try { return call(() -> { File userFile = new File(usersDir, uuid.toString() + ".json"); @@ -140,7 +139,6 @@ public class JSONDatastore extends FlatfileDatastore { } }, false); } finally { - plugin.getLog().info("#loadUser finished for: " + user.getName()); user.getIoLock().unlock(); } } @@ -148,7 +146,6 @@ public class JSONDatastore extends FlatfileDatastore { @Override public boolean saveUser(User user) { user.getIoLock().lock(); - plugin.getLog().info("#saveUser for: " + user.getName()); try { return call(() -> { File userFile = new File(usersDir, user.getUuid().toString() + ".json"); @@ -176,7 +173,6 @@ public class JSONDatastore extends FlatfileDatastore { writer.name("perms"); writer.beginObject(); for (Map.Entry e : exportToLegacy(user.getNodes()).entrySet()) { - plugin.getLog().info("entry: " + e.toString()); writer.name(e.getKey()).value(e.getValue().booleanValue()); } writer.endObject(); @@ -185,7 +181,6 @@ public class JSONDatastore extends FlatfileDatastore { }); }, false); } finally { - plugin.getLog().info("#saveUser ended for: " + user.getName()); user.getIoLock().unlock(); } }