Fix migration log being sent to the console twice
This commit is contained in:
@@ -180,7 +180,9 @@ public class MigrationBPermissions extends SubCommand<Object> {
|
||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, Object o, List<String> args, String label) throws CommandException {
|
||||
Consumer<String> log = s -> {
|
||||
Message.MIGRATION_LOG.send(sender, s);
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
if (!sender.isConsole()) {
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
}
|
||||
};
|
||||
log.accept("Starting bPermissions migration.");
|
||||
|
||||
|
||||
@@ -64,7 +64,9 @@ public class MigrationGroupManager extends SubCommand<Object> {
|
||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, Object o, List<String> args, String label) throws CommandException {
|
||||
Consumer<String> log = s -> {
|
||||
Message.MIGRATION_LOG.send(sender, s);
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
if (!sender.isConsole()) {
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
}
|
||||
};
|
||||
log.accept("Starting GroupManager migration.");
|
||||
|
||||
|
||||
+3
-1
@@ -65,7 +65,9 @@ public class MigrationPermissionsEx extends SubCommand<Object> {
|
||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, Object o, List<String> args, String label) throws CommandException {
|
||||
Consumer<String> log = s -> {
|
||||
Message.MIGRATION_LOG.send(sender, s);
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
if (!sender.isConsole()) {
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
}
|
||||
};
|
||||
log.accept("Starting PermissionsEx migration.");
|
||||
|
||||
|
||||
+3
-1
@@ -200,7 +200,9 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
|
||||
private CommandResult run(LuckPermsPlugin plugin, Sender sender, List<String> args) {
|
||||
Consumer<String> log = s -> {
|
||||
Message.MIGRATION_LOG.send(sender, s);
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
if (!sender.isConsole()) {
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
}
|
||||
};
|
||||
log.accept("Starting PowerfulPerms migration.");
|
||||
|
||||
|
||||
@@ -60,7 +60,9 @@ public class MigrationZPermissions extends SubCommand<Object> {
|
||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, Object o, List<String> args, String label) throws CommandException {
|
||||
Consumer<String> log = s -> {
|
||||
Message.MIGRATION_LOG.send(sender, s);
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
if (!sender.isConsole()) {
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
}
|
||||
};
|
||||
log.accept("Starting zPermissions migration.");
|
||||
|
||||
|
||||
@@ -57,7 +57,9 @@ public class MigrationBungeePerms extends SubCommand<Object> {
|
||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, Object o, List<String> args, String label) throws CommandException {
|
||||
Consumer<String> log = s -> {
|
||||
Message.MIGRATION_LOG.send(sender, s);
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
if (!sender.isConsole()) {
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
}
|
||||
};
|
||||
log.accept("Starting BungeePerms migration.");
|
||||
|
||||
|
||||
@@ -110,7 +110,12 @@ public class ExportCommand extends SingleCommand {
|
||||
|
||||
@Override
|
||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, List<String> args, String label) {
|
||||
Consumer<String> log = s -> Message.EXPORT_LOG.send(sender, s);
|
||||
Consumer<String> log = s -> {
|
||||
Message.EXPORT_LOG.send(sender, s);
|
||||
if (!sender.isConsole()) {
|
||||
Message.EXPORT_LOG.send(plugin.getConsoleSender(), s);
|
||||
}
|
||||
};
|
||||
|
||||
File f = new File(plugin.getDataDirectory(), args.get(0));
|
||||
if (f.exists()) {
|
||||
|
||||
@@ -86,7 +86,8 @@ public class AbstractSender<T> implements Sender {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isConsole() {
|
||||
@Override
|
||||
public boolean isConsole() {
|
||||
return this.uuid.equals(Constants.CONSOLE_UUID) || this.uuid.equals(Constants.IMPORT_UUID);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,4 +78,11 @@ public interface Sender {
|
||||
*/
|
||||
boolean hasPermission(Permission permission);
|
||||
|
||||
/**
|
||||
* Gets whether this sender is the console
|
||||
*
|
||||
* @return if the sender is the console
|
||||
*/
|
||||
boolean isConsole();
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -57,7 +57,9 @@ public class MigrationPermissionManager extends SubCommand<Object> {
|
||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, Object o, List<String> args, String label) throws CommandException {
|
||||
Consumer<String> log = s -> {
|
||||
Message.MIGRATION_LOG.send(sender, s);
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
if (!sender.isConsole()) {
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
}
|
||||
};
|
||||
log.accept("Starting PermissionManager migration.");
|
||||
|
||||
|
||||
+3
-1
@@ -64,7 +64,9 @@ public class MigrationPermissionsEx extends SubCommand<Object> {
|
||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, Object o, List<String> args, String label) throws CommandException {
|
||||
Consumer<String> log = s -> {
|
||||
Message.MIGRATION_LOG.send(sender, s);
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
if (!sender.isConsole()) {
|
||||
Message.MIGRATION_LOG.send(plugin.getConsoleSender(), s);
|
||||
}
|
||||
};
|
||||
log.accept("Starting PermissionsEx migration.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user