diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java index 6ff66de26..a3f7d84d9 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java @@ -66,6 +66,7 @@ class BukkitListener extends AbstractListener implements Listener { deniedAsyncLogin.add(e.getUniqueId()); // The datastore is disabled, prevent players from joining the server + plugin.getLog().warn("The plugin storage is not loaded. Denying connection from: " + e.getUniqueId() + " - " + e.getName()); e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, Message.LOADING_ERROR.toString()); return; } @@ -81,9 +82,8 @@ class BukkitListener extends AbstractListener implements Listener { return; } + // Login event was cancelled by another plugin if (plugin.isStarted() && plugin.getStorage().isAcceptingLogins() && e.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) { - - // Login event was cancelled by another plugin onLeave(e.getUniqueId()); } } @@ -102,6 +102,7 @@ class BukkitListener extends AbstractListener implements Listener { deniedLogin.add(e.getPlayer().getUniqueId()); // User wasn't loaded for whatever reason. + plugin.getLog().warn("User " + player.getUniqueId() + " - " + player.getName() + " could not be loaded. - denying login."); e.disallow(PlayerLoginEvent.Result.KICK_OTHER, Message.LOADING_ERROR.toString()); return; } diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java index b4afa707f..f6a9b875f 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java @@ -66,7 +66,6 @@ import java.util.function.Consumer; import static me.lucko.luckperms.common.constants.Permission.MIGRATION; - public class MigrationPowerfulPerms extends SubCommand { private static Method getPlayerPermissionsMethod = null; private static Method getPlayerGroupsMethod = null; diff --git a/bungee/src/main/resources/plugin.yml b/bungee/src/main/resources/plugin.yml index 50cf41626..2706b564c 100644 --- a/bungee/src/main/resources/plugin.yml +++ b/bungee/src/main/resources/plugin.yml @@ -3,4 +3,3 @@ version: ${release.version}.${patch.version} description: A permissions plugin author: Luck main: me.lucko.luckperms.bungee.LPBungeePlugin -softdepends: [PowerfulPerms] # For migration diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java index d65d7a2d1..c4b5782be 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java @@ -44,6 +44,7 @@ import java.io.FileWriter; import java.io.IOException; import java.nio.file.Files; import java.text.SimpleDateFormat; +import java.util.Collection; import java.util.Date; import java.util.List; import java.util.Set; @@ -129,25 +130,32 @@ public class ExportCommand extends SingleCommand { // Export tracks log.log("Starting track export."); - // Create the actual tracks first - write(writer, "# Create tracks"); - for (Track track : plugin.getTrackManager().getAll().values()) { - write(writer, "/luckperms createtrack " + track.getName()); - } + Collection tracks = plugin.getTrackManager().getAll().values(); + if (!tracks.isEmpty()) { - AtomicInteger trackCount = new AtomicInteger(0); - for (Track track : plugin.getTrackManager().getAll().values()) { - write(writer, "# Export track: " + track.getName()); - for (String group : track.getGroups()) { - write(writer, "/luckperms track " + track.getName() + " append " + group); + // Create the actual tracks first + write(writer, "# Create tracks"); + for (Track track : tracks) { + write(writer, "/luckperms createtrack " + track.getName()); } - write(writer, ""); - log.logAllProgress("Exported {} tracks so far.", trackCount.incrementAndGet()); - } - log.log("Exported " + trackCount.get() + " tracks."); - write(writer, ""); - write(writer, ""); + write(writer, ""); + + AtomicInteger trackCount = new AtomicInteger(0); + for (Track track : plugin.getTrackManager().getAll().values()) { + write(writer, "# Export track: " + track.getName()); + for (String group : track.getGroups()) { + write(writer, "/luckperms track " + track.getName() + " append " + group); + } + write(writer, ""); + log.logAllProgress("Exported {} tracks so far.", trackCount.incrementAndGet()); + } + + write(writer, ""); + write(writer, ""); + } + + log.log("Exported " + tracks.size() + " tracks."); // Export users log.log("Starting user export. Finding a list of unique users to export."); diff --git a/common/src/main/java/me/lucko/luckperms/common/data/Importer.java b/common/src/main/java/me/lucko/luckperms/common/data/Importer.java index 51fbb2615..706416510 100644 --- a/common/src/main/java/me/lucko/luckperms/common/data/Importer.java +++ b/common/src/main/java/me/lucko/luckperms/common/data/Importer.java @@ -81,6 +81,7 @@ public class Importer { this.notify = ImmutableSet.of(executor, commandManager.getPlugin().getConsoleSender()); } this.commands = commands.stream() + .map(String::trim) .filter(s -> !s.isEmpty()) .filter(s -> !s.startsWith("#")) .filter(s -> !s.startsWith("//")) diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java index f061dd8bd..f9df8d231 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java @@ -240,7 +240,7 @@ public class LPSpongePlugin implements LuckPermsPlugin { getLog().info("Registering commands..."); CommandManager cmdService = game.getCommandManager(); SpongeCommand commandManager = new SpongeCommand(this); - cmdService.register(this, commandManager, "luckperms", "perms", "lp", "permissions", "p", "perm"); + cmdService.register(this, commandManager, "luckperms", "perms", "lp", "permissions", "perm"); // load internal managers getLog().info("Loading internal permission managers..."); diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationUtils.java b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationUtils.java index 538f95a1e..e854a58b2 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationUtils.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationUtils.java @@ -46,6 +46,7 @@ import java.util.Set; public class MigrationUtils { public static void migrateSubject(Subject subject, PermissionHolder holder, int priority) { + // Migrate permissions Map, Map> perms = subject.getSubjectData().getAllPermissions(); for (Map.Entry, Map> e : perms.entrySet()) { @@ -94,7 +95,6 @@ public class MigrationUtils { // Ignore. This is just so older versions of Sponge API can be used. } - // Migrate parents Map, List> parents = subject.getSubjectData().getAllParents(); for (Map.Entry, List> e : parents.entrySet()) {