Fix migration log being sent to the console twice
This commit is contained in:
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user