Minor - remove code duplication

This commit is contained in:
ljacqu 2017-10-08 01:22:25 +02:00
parent 278146a206
commit f1bed873d5

View File

@ -5,11 +5,12 @@ import fr.xephi.authme.data.auth.PlayerAuth;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.datasource.DataSourceType;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import java.util.ArrayList;
import java.util.List;
import static fr.xephi.authme.util.Utils.logAndSendMessage;
/**
* Converts from one AuthMe data source type to another.
*
@ -87,13 +88,4 @@ public abstract class AbstractDataSourceConverter<S extends DataSource> implemen
* @throws Exception during initialization of source
*/
protected abstract S getSource() throws Exception;
private static void logAndSendMessage(CommandSender sender, String message) {
ConsoleLogger.info(message);
// Make sure sender is not console user, which will see the message from ConsoleLogger already
if (sender != null && !(sender instanceof ConsoleCommandSender)) {
sender.sendMessage(message);
}
}
}