Fix minor Checkstyle violations
- Mostly missing JavaDoc, some line lengths
This commit is contained in:
@@ -172,6 +172,11 @@ class MySqlDefaultChanger implements DebugSection {
|
||||
+ sender.getName() + "'");
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the current definitions of all {@link Columns} which can be migrated.
|
||||
*
|
||||
* @param sender command sender to output the data to
|
||||
*/
|
||||
private void showColumnDetails(CommandSender sender) {
|
||||
sender.sendMessage(ChatColor.BLUE + "MySQL column details");
|
||||
final String tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
|
||||
|
||||
@@ -28,6 +28,10 @@ import java.util.Set;
|
||||
import static fr.xephi.authme.datasource.SqlDataSourceUtils.getNullableLong;
|
||||
import static fr.xephi.authme.datasource.SqlDataSourceUtils.logSqlException;
|
||||
|
||||
/**
|
||||
* MySQL data source.
|
||||
*/
|
||||
@SuppressWarnings({"checkstyle:AbbreviationAsWordInName"}) // Justification: Class name cannot be changed anymore
|
||||
public class MySQL implements DataSource {
|
||||
|
||||
private boolean useSsl;
|
||||
@@ -728,6 +732,13 @@ public class MySQL implements DataSource {
|
||||
return players;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link PlayerAuth} object with the data from the provided result set.
|
||||
*
|
||||
* @param row the result set to read from
|
||||
* @return generated player auth object with the data from the result set
|
||||
* @throws SQLException .
|
||||
*/
|
||||
private PlayerAuth buildAuthFromResultSet(ResultSet row) throws SQLException {
|
||||
String salt = col.SALT.isEmpty() ? null : row.getString(col.SALT);
|
||||
int group = col.GROUP.isEmpty() ? -1 : row.getInt(col.GROUP);
|
||||
|
||||
@@ -28,6 +28,7 @@ import static fr.xephi.authme.datasource.SqlDataSourceUtils.logSqlException;
|
||||
/**
|
||||
* SQLite data source.
|
||||
*/
|
||||
@SuppressWarnings({"checkstyle:AbbreviationAsWordInName"}) // Justification: Class name cannot be changed anymore
|
||||
public class SQLite implements DataSource {
|
||||
|
||||
private final Settings settings;
|
||||
|
||||
@@ -12,10 +12,11 @@ import javax.inject.Inject;
|
||||
|
||||
public class PlayerListener19Spigot implements Listener {
|
||||
|
||||
private static boolean isPlayerSpawnLocationEventCalled = false;
|
||||
|
||||
@Inject
|
||||
private TeleportationService teleportationService;
|
||||
|
||||
private static boolean isPlayerSpawnLocationEventCalled = false;
|
||||
|
||||
public static boolean isPlayerSpawnLocationEventCalled() {
|
||||
return isPlayerSpawnLocationEventCalled;
|
||||
|
||||
@@ -62,7 +62,8 @@ public class LuckPermsHandler implements PermissionHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
DataMutateResult result = user.setPermissionUnchecked(luckPermsApi.getNodeFactory().makeGroupNode(newGroup).build());
|
||||
DataMutateResult result = user.setPermissionUnchecked(
|
||||
luckPermsApi.getNodeFactory().makeGroupNode(newGroup).build());
|
||||
if (result == DataMutateResult.FAIL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
||||
/**
|
||||
* Performs synchronous tasks after a successful {@link RegistrationType#EMAIL email registration}.
|
||||
*/
|
||||
public class ProcessSyncEmailRegister implements SynchronousProcess {
|
||||
|
||||
@Inject
|
||||
@@ -22,6 +24,11 @@ public class ProcessSyncEmailRegister implements SynchronousProcess {
|
||||
ProcessSyncEmailRegister() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs sync tasks for a player which has just registered by email.
|
||||
*
|
||||
* @param player the recently registered player
|
||||
*/
|
||||
public void processEmailRegister(Player player) {
|
||||
service.send(player, MessageKey.ACCOUNT_NOT_ACTIVATED);
|
||||
limboService.replaceTasksAfterRegistration(player);
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.bukkit.entity.Player;
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* Performs synchronous tasks after a successful {@link RegistrationType#PASSWORD password registration}.
|
||||
*/
|
||||
public class ProcessSyncPasswordRegister implements SynchronousProcess {
|
||||
|
||||
@@ -46,6 +47,11 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes a player having registered with a password.
|
||||
*
|
||||
* @param player the newly registered player
|
||||
*/
|
||||
public void processPasswordRegister(Player player) {
|
||||
service.send(player, MessageKey.REGISTER_SUCCESS);
|
||||
|
||||
|
||||
@@ -56,9 +56,9 @@ public class SettingsWarner {
|
||||
// Warn if spigot.yml has settings.bungeecord set to true but config.yml has Hooks.bungeecord set to false
|
||||
if (Utils.isSpigot() && Bukkit.spigot().getConfig().getBoolean("settings.bungeecord")
|
||||
&& !settings.getProperty(HooksSettings.BUNGEECORD)) {
|
||||
ConsoleLogger.warning("Note: Hooks.bungeecord is set to false but your server appears to be running in" +
|
||||
" bungeecord mode (see your spigot.yml). In order to allow the datasource caching and the AuthMeBungee" +
|
||||
" add-on to work properly you have to enable this option!");
|
||||
ConsoleLogger.warning("Note: Hooks.bungeecord is set to false but your server appears to be running in"
|
||||
+ " bungeecord mode (see your spigot.yml). In order to allow the datasource caching and the"
|
||||
+ " AuthMeBungee add-on to work properly you have to enable this option!");
|
||||
}
|
||||
|
||||
// Check if argon2 library is present and can be loaded
|
||||
|
||||
@@ -61,6 +61,11 @@ public class PurgeExecutor {
|
||||
purgePermissions(players);
|
||||
}
|
||||
|
||||
/**
|
||||
* Purges data from the AntiXray plugin.
|
||||
*
|
||||
* @param cleared the players whose data should be cleared
|
||||
*/
|
||||
synchronized void purgeAntiXray(Collection<String> cleared) {
|
||||
if (!settings.getProperty(PurgeSettings.REMOVE_ANTI_XRAY_FILE)) {
|
||||
return;
|
||||
@@ -95,6 +100,11 @@ public class PurgeExecutor {
|
||||
ConsoleLogger.info(ChatColor.GOLD + "Deleted " + names.size() + " user accounts");
|
||||
}
|
||||
|
||||
/**
|
||||
* Purges data from the LimitedCreative plugin.
|
||||
*
|
||||
* @param cleared the players whose data should be cleared
|
||||
*/
|
||||
synchronized void purgeLimitedCreative(Collection<String> cleared) {
|
||||
if (!settings.getProperty(PurgeSettings.REMOVE_LIMITED_CREATIVE_INVENTORIES)) {
|
||||
return;
|
||||
@@ -191,6 +201,11 @@ public class PurgeExecutor {
|
||||
ConsoleLogger.info("AutoPurge: Removed " + deletedFiles + " EssentialsFiles");
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes permission data (groups a user belongs to) for the given players.
|
||||
*
|
||||
* @param cleared the players to remove data for
|
||||
*/
|
||||
synchronized void purgePermissions(Collection<OfflinePlayer> cleared) {
|
||||
if (!settings.getProperty(PurgeSettings.REMOVE_PERMISSIONS)) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user