mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-10-31 07:39:42 +01:00
Minor - remove code duplication
This commit is contained in:
parent
278146a206
commit
f1bed873d5
@ -5,11 +5,12 @@ import fr.xephi.authme.data.auth.PlayerAuth;
|
|||||||
import fr.xephi.authme.datasource.DataSource;
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
import fr.xephi.authme.datasource.DataSourceType;
|
import fr.xephi.authme.datasource.DataSourceType;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static fr.xephi.authme.util.Utils.logAndSendMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts from one AuthMe data source type to another.
|
* 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
|
* @throws Exception during initialization of source
|
||||||
*/
|
*/
|
||||||
protected abstract S getSource() throws Exception;
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user