Stuff from the common floobits workspace

Author:    AuthMe-Team <AuthMeTeam@123NoEmail.com>
This commit is contained in:
AuthMe-Team
2015-11-23 20:20:42 +01:00
committed by Gabriele C
parent 69a09aec17
commit 9ec2d6d059
169 changed files with 5161 additions and 4806 deletions
@@ -1,10 +1,9 @@
package fr.xephi.authme.command.executable;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.command.help.HelpProvider;
import org.bukkit.command.CommandSender;
/**
*/
@@ -1,16 +1,15 @@
package fr.xephi.authme.command.executable.authme;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Messages;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import java.util.List;
/**
*/
@@ -26,7 +25,7 @@ public class AccountsCommand extends ExecutableCommand {
// Get the player query
String playerQuery = sender.getName();
if(commandArguments.getCount() >= 1)
if (commandArguments.getCount() >= 1)
playerQuery = commandArguments.get(0);
final String playerQueryFinal = playerQuery;
@@ -1,11 +1,10 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
/**
*/
@@ -14,7 +13,7 @@ public class AuthMeCommand extends ExecutableCommand {
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// Show some version info
sender.sendMessage(ChatColor.GREEN + "This server is running " + AuthMe.PLUGIN_NAME + " v" + AuthMe.getVersionName() + "! " + ChatColor.RED + "<3");
sender.sendMessage(ChatColor.GREEN + "This server is running " + AuthMe.getPluginName() + " v" + AuthMe.getVersionName() + "! " + ChatColor.RED + "<3");
sender.sendMessage(ChatColor.YELLOW + "Use the command " + ChatColor.GOLD + "/" + commandReference.get(0) + " help" + ChatColor.YELLOW + " to view help.");
sender.sendMessage(ChatColor.YELLOW + "Use the command " + ChatColor.GOLD + "/" + commandReference.get(0) + " about" + ChatColor.YELLOW + " to view about.");
return true;
@@ -1,10 +1,5 @@
package fr.xephi.authme.command.executable.authme;
import java.security.NoSuchAlgorithmException;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.cache.auth.PlayerAuth;
@@ -14,6 +9,10 @@ import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.security.PasswordSecurity;
import fr.xephi.authme.settings.Messages;
import fr.xephi.authme.settings.Settings;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import java.security.NoSuchAlgorithmException;
/**
*/
@@ -1,12 +1,11 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Spawn;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -1,12 +1,11 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -19,7 +18,7 @@ public class ForceLoginCommand extends ExecutableCommand {
// Get the player query
String playerName = sender.getName();
if(commandArguments.getCount() >= 1)
if (commandArguments.getCount() >= 1)
playerName = commandArguments.get(0);
// Command logic
@@ -1,12 +1,11 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Messages;
import org.bukkit.command.CommandSender;
/**
*/
@@ -18,14 +17,13 @@ public class GetEmailCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// Get the player name
String playerName = sender.getName();
if(commandArguments.getCount() >= 1)
if (commandArguments.getCount() >= 1)
playerName = commandArguments.get(0);
// Get the authenticated user
@@ -1,12 +1,11 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -19,7 +18,7 @@ public class GetIpCommand extends ExecutableCommand {
// Get the player query
String playerName = sender.getName();
if(commandArguments.getCount() >= 1)
if (commandArguments.getCount() >= 1)
playerName = commandArguments.get(0);
@SuppressWarnings("deprecation")
@@ -1,14 +1,13 @@
package fr.xephi.authme.command.executable.authme;
import java.util.Date;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Messages;
import org.bukkit.command.CommandSender;
import java.util.Date;
/**
*/
@@ -18,7 +17,7 @@ public class LastLoginCommand extends ExecutableCommand {
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// Get the player
String playerName = sender.getName();
if(commandArguments.getCount() >= 1)
if (commandArguments.getCount() >= 1)
playerName = commandArguments.get(0);
// Validate the player
@@ -1,15 +1,14 @@
package fr.xephi.authme.command.executable.authme;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Settings;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
import java.util.ArrayList;
import java.util.List;
/**
*/
@@ -21,9 +20,8 @@ public class PurgeBannedPlayersCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
@@ -1,15 +1,14 @@
package fr.xephi.authme.command.executable.authme;
import java.util.Calendar;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Settings;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import java.util.Calendar;
import java.util.List;
/**
*/
@@ -21,9 +20,8 @@ public class PurgeCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
@@ -36,13 +34,13 @@ public class PurgeCommand extends ExecutableCommand {
int days;
try {
days = Integer.valueOf(daysStr);
} catch(Exception ex) {
} catch (Exception ex) {
sender.sendMessage(ChatColor.RED + "The value you've entered is invalid!");
return true;
}
// Validate the value
if(days < 30) {
if (days < 30) {
sender.sendMessage(ChatColor.RED + "You can only purge data older than 30 days");
return true;
}
@@ -59,13 +57,13 @@ public class PurgeCommand extends ExecutableCommand {
sender.sendMessage(ChatColor.GOLD + "Deleted " + purged.size() + " user accounts");
// Purge other data
if(Settings.purgeEssentialsFile && plugin.ess != null)
if (Settings.purgeEssentialsFile && plugin.ess != null)
plugin.dataManager.purgeEssentials(purged);
if(Settings.purgePlayerDat)
if (Settings.purgePlayerDat)
plugin.dataManager.purgeDat(purged);
if(Settings.purgeLimitedCreative)
if (Settings.purgeLimitedCreative)
plugin.dataManager.purgeLimitedCreative(purged);
if(Settings.purgeAntiXray)
if (Settings.purgeAntiXray)
plugin.dataManager.purgeAntiXray(purged);
// Show a status message
@@ -1,14 +1,13 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Messages;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -20,9 +19,8 @@ public class PurgeLastPositionCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(final CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
@@ -33,7 +31,7 @@ public class PurgeLastPositionCommand extends ExecutableCommand {
// Get the player
String playerName = sender.getName();
if(commandArguments.getCount() >= 1)
if (commandArguments.getCount() >= 1)
playerName = commandArguments.get(0);
String playerNameLowerCase = playerName.toLowerCase();
@@ -1,10 +1,5 @@
package fr.xephi.authme.command.executable.authme;
import java.security.NoSuchAlgorithmException;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.cache.auth.PlayerAuth;
@@ -13,6 +8,10 @@ import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.security.PasswordSecurity;
import fr.xephi.authme.settings.Messages;
import fr.xephi.authme.settings.Settings;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import java.security.NoSuchAlgorithmException;
/**
*/
@@ -24,9 +23,8 @@ public class RegisterCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(final CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
@@ -1,7 +1,6 @@
package fr.xephi.authme.command.executable.authme;
//import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
@@ -10,6 +9,7 @@ import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Messages;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.util.Profiler;
import org.bukkit.command.CommandSender;
/**
*/
@@ -21,9 +21,8 @@ public class ReloadCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// Profile the reload process
@@ -1,14 +1,13 @@
package fr.xephi.authme.command.executable.authme;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import java.util.List;
/**
*/
@@ -20,9 +19,8 @@ public class ResetNameCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
@@ -33,7 +31,7 @@ public class ResetNameCommand extends ExecutableCommand {
@Override
public void run() {
List<PlayerAuth> authentications = plugin.database.getAllAuths();
for(PlayerAuth auth : authentications) {
for (PlayerAuth auth : authentications) {
auth.setRealName("Player");
plugin.database.updateSession(auth);
}
@@ -1,7 +1,5 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache;
@@ -9,6 +7,7 @@ import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Messages;
import fr.xephi.authme.settings.Settings;
import org.bukkit.command.CommandSender;
/**
*/
@@ -20,9 +19,8 @@ public class SetEmailCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
@@ -1,12 +1,11 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Spawn;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -18,9 +17,8 @@ public class SetFirstSpawnCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
try {
@@ -1,12 +1,11 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Spawn;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -18,9 +17,8 @@ public class SetSpawnCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// Make sure the command executor is a player
@@ -1,12 +1,11 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Spawn;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -18,9 +17,8 @@ public class SpawnCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// Make sure the command executor is a player
@@ -1,12 +1,11 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.command.help.HelpProvider;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
/**
*/
@@ -18,9 +17,8 @@ public class SwitchAntiBotCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(final CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
@@ -28,18 +26,18 @@ public class SwitchAntiBotCommand extends ExecutableCommand {
// Get the new state
String newState = plugin.getAntiBotModMode() ? "OFF" : "ON";
if(commandArguments.getCount() >= 1)
if (commandArguments.getCount() >= 1)
newState = commandArguments.get(0);
// Enable the mod
if(newState.equalsIgnoreCase("ON")) {
if (newState.equalsIgnoreCase("ON")) {
plugin.switchAntiBotMod(true);
sender.sendMessage("[AuthMe] AntiBotMod enabled");
return true;
}
// Disable the mod
if(newState.equalsIgnoreCase("OFF")) {
if (newState.equalsIgnoreCase("OFF")) {
plugin.switchAntiBotMod(false);
sender.sendMessage("[AuthMe] AntiBotMod disabled");
return true;
@@ -1,13 +1,5 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.scheduler.BukkitTask;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.cache.auth.PlayerCache;
@@ -19,6 +11,13 @@ import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.task.MessageTask;
import fr.xephi.authme.task.TimeoutTask;
import fr.xephi.authme.util.Utils;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.scheduler.BukkitTask;
/**
*/
@@ -30,8 +29,8 @@ public class UnregisterCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(final CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
@@ -1,13 +1,12 @@
package fr.xephi.authme.command.executable.authme;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -19,14 +18,13 @@ public class VersionCommand extends ExecutableCommand {
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// Show some version info
sender.sendMessage(ChatColor.GOLD + "==========[ " + AuthMe.PLUGIN_NAME.toUpperCase() + " ABOUT ]==========");
sender.sendMessage(ChatColor.GOLD + "Version: " + ChatColor.WHITE + AuthMe.PLUGIN_NAME + " v" + AuthMe.getVersionName() + ChatColor.GRAY + " (code: " + AuthMe.getVersionCode() + ")");
sender.sendMessage(ChatColor.GOLD + "==========[ " + AuthMe.getPluginName().toUpperCase() + " ABOUT ]==========");
sender.sendMessage(ChatColor.GOLD + "Version: " + ChatColor.WHITE + AuthMe.getPluginName() + " v" + AuthMe.getVersionName() + ChatColor.GRAY + " (code: " + AuthMe.getVersionCode() + ")");
sender.sendMessage(ChatColor.GOLD + "Developers:");
printDeveloper(sender, "Xephi", "xephi59", "Lead Developer");
printDeveloper(sender, "DNx5", "DNx5", "Developer");
@@ -42,10 +40,10 @@ public class VersionCommand extends ExecutableCommand {
/**
* Print a developer with proper styling.
*
* @param sender The command sender.
* @param name The display name of the developer.
* @param sender The command sender.
* @param name The display name of the developer.
* @param minecraftName The Minecraft username of the developer, if available.
* @param function The function of the developer.
* @param function The function of the developer.
*/
@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
private void printDeveloper(CommandSender sender, String name, String minecraftName, String function) {
@@ -55,13 +53,13 @@ public class VersionCommand extends ExecutableCommand {
msg.append(name);
// Append the Minecraft name, if available
if(minecraftName.length() != 0)
if (minecraftName.length() != 0)
msg.append(ChatColor.GRAY + " // " + ChatColor.WHITE + minecraftName);
msg.append(ChatColor.GRAY + "" + ChatColor.ITALIC + " (" + function + ")");
// Show the online status
if(minecraftName.length() != 0)
if(isPlayerOnline(minecraftName))
if (minecraftName.length() != 0)
if (isPlayerOnline(minecraftName))
msg.append(ChatColor.GREEN + "" + ChatColor.ITALIC + " (In-Game)");
// Print the message
@@ -72,7 +70,6 @@ public class VersionCommand extends ExecutableCommand {
* Check whether a player is online.
*
* @param minecraftName The Minecraft player name.
*
* @return True if the player is online, false otherwise.
*/
private boolean isPlayerOnline(String minecraftName) {
@@ -1,8 +1,5 @@
package fr.xephi.authme.command.executable.captcha;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.command.CommandParts;
@@ -10,6 +7,8 @@ import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.security.RandomString;
import fr.xephi.authme.settings.Messages;
import fr.xephi.authme.settings.Settings;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -18,12 +17,11 @@ public class CaptchaCommand extends ExecutableCommand {
/**
* Execute the command.
*
* @param sender The command sender.
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
@@ -39,7 +37,7 @@ public class CaptchaCommand extends ExecutableCommand {
String captcha = commandArguments.get(0);
// Make sure the current command executor is a player
if(!(sender instanceof Player)) {
if (!(sender instanceof Player)) {
return true;
}
@@ -75,7 +73,8 @@ public class CaptchaCommand extends ExecutableCommand {
try {
plugin.captcha.remove(playerNameLowerCase);
plugin.cap.remove(playerNameLowerCase);
} catch (NullPointerException ignored) { }
} catch (NullPointerException ignored) {
}
// Show a status message
m.send(player, "valid_captcha");
@@ -1,8 +1,5 @@
package fr.xephi.authme.command.executable.changepassword;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.command.CommandParts;
@@ -10,6 +7,8 @@ import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Messages;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.task.ChangePasswordTask;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -24,7 +23,7 @@ public class ChangePasswordCommand extends ExecutableCommand {
String playerPassVerify = commandArguments.get(1);
// Make sure the current command executor is a player
if(!(sender instanceof Player)) {
if (!(sender instanceof Player)) {
return true;
}
@@ -1,21 +1,12 @@
package fr.xephi.authme.command.executable.converter;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.converter.Converter;
import fr.xephi.authme.converter.CrazyLoginConverter;
import fr.xephi.authme.converter.FlatToSql;
import fr.xephi.authme.converter.FlatToSqlite;
import fr.xephi.authme.converter.RakamakConverter;
import fr.xephi.authme.converter.RoyalAuthConverter;
import fr.xephi.authme.converter.SqlToFlat;
import fr.xephi.authme.converter.vAuthConverter;
import fr.xephi.authme.converter.xAuthConverter;
import fr.xephi.authme.converter.*;
import fr.xephi.authme.settings.Messages;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
/**
*/
@@ -24,12 +15,11 @@ public class ConverterCommand extends ExecutableCommand {
/**
* Execute the command.
*
* @param sender The command sender.
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
@@ -51,32 +41,32 @@ public class ConverterCommand extends ExecutableCommand {
// Get the proper converter instance
Converter converter = null;
switch (jobType) {
case ftsql:
converter = new FlatToSql();
break;
case ftsqlite:
converter = new FlatToSqlite(sender);
break;
case xauth:
converter = new xAuthConverter(plugin, sender);
break;
case crazylogin:
converter = new CrazyLoginConverter(plugin, sender);
break;
case rakamak:
converter = new RakamakConverter(plugin, sender);
break;
case royalauth:
converter = new RoyalAuthConverter(plugin);
break;
case vauth:
converter = new vAuthConverter(plugin, sender);
break;
case sqltoflat:
converter = new SqlToFlat(plugin, sender);
break;
default:
break;
case ftsql:
converter = new FlatToSql();
break;
case ftsqlite:
converter = new FlatToSqlite(sender);
break;
case xauth:
converter = new xAuthConverter(plugin, sender);
break;
case crazylogin:
converter = new CrazyLoginConverter(plugin, sender);
break;
case rakamak:
converter = new RakamakConverter(plugin, sender);
break;
case royalauth:
converter = new RoyalAuthConverter(plugin);
break;
case vauth:
converter = new vAuthConverter(plugin, sender);
break;
case sqltoflat:
converter = new SqlToFlat(plugin, sender);
break;
default:
break;
}
// Run the convert job
@@ -103,25 +93,19 @@ public class ConverterCommand extends ExecutableCommand {
/**
* Constructor for ConvertType.
*
* @param name String
*/
ConvertType(String name) {
this.name = name;
}
/**
* Method getName.
* @return String */
String getName() {
return this.name;
}
/**
* Method fromName.
*
* @param name String
* @return ConvertType */
* @return ConvertType
*/
public static ConvertType fromName(String name) {
for (ConvertType type : ConvertType.values()) {
if (type.getName().equalsIgnoreCase(name))
@@ -129,5 +113,14 @@ public class ConverterCommand extends ExecutableCommand {
}
return null;
}
/**
* Method getName.
*
* @return String
*/
String getName() {
return this.name;
}
}
}
@@ -1,11 +1,10 @@
package fr.xephi.authme.command.executable.email;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -1,11 +1,10 @@
package fr.xephi.authme.command.executable.email;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -1,10 +1,5 @@
package fr.xephi.authme.command.executable.email;
import java.security.NoSuchAlgorithmException;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.cache.auth.PlayerAuth;
@@ -15,6 +10,10 @@ import fr.xephi.authme.security.PasswordSecurity;
import fr.xephi.authme.security.RandomString;
import fr.xephi.authme.settings.Messages;
import fr.xephi.authme.settings.Settings;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.security.NoSuchAlgorithmException;
/**
*/
@@ -26,7 +25,7 @@ public class RecoverEmailCommand extends ExecutableCommand {
String playerMail = commandArguments.get(0);
// Make sure the current command executor is a player
if(!(sender instanceof Player)) {
if (!(sender instanceof Player)) {
return true;
}
@@ -1,11 +1,10 @@
package fr.xephi.authme.command.executable.login;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -1,11 +1,10 @@
package fr.xephi.authme.command.executable.logout;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -1,15 +1,14 @@
package fr.xephi.authme.command.executable.register;
import fr.xephi.authme.process.Management;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.process.Management;
import fr.xephi.authme.security.RandomString;
import fr.xephi.authme.settings.Messages;
import fr.xephi.authme.settings.Settings;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -1,13 +1,12 @@
package fr.xephi.authme.command.executable.unregister;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.command.CommandParts;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.settings.Messages;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*/
@@ -16,12 +15,11 @@ public class UnregisterCommand extends ExecutableCommand {
/**
* Execute the command.
*
* @param sender The command sender.
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
* @return True if the command was executed successfully, false otherwise.
*/
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
@@ -31,7 +29,7 @@ public class UnregisterCommand extends ExecutableCommand {
final Messages m = Messages.getInstance();
// Make sure the current command executor is a player
if(!(sender instanceof Player)) {
if (!(sender instanceof Player)) {
return true;
}