Implemented getemail command
Various other improvements.
This commit is contained in:
@@ -25,6 +25,7 @@ public class AccountsCommand extends ExecutableCommand {
|
||||
public boolean executeCommand(final CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
|
||||
// AuthMe plugin instance
|
||||
final AuthMe plugin = AuthMe.getInstance();
|
||||
|
||||
// Messages instance
|
||||
final Messages m = Messages.getInstance();
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
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;
|
||||
|
||||
public class GetEmailCommand extends ExecutableCommand {
|
||||
|
||||
/**
|
||||
* Execute the command.
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
@Override
|
||||
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
|
||||
// AuthMe plugin instance
|
||||
AuthMe plugin = AuthMe.getInstance();
|
||||
|
||||
// Messages instance
|
||||
Messages m = Messages.getInstance();
|
||||
|
||||
// Get the player name
|
||||
String playerName = sender.getName();
|
||||
if(commandArguments.getCount() >= 1)
|
||||
playerName = commandArguments.get(0);
|
||||
|
||||
// Get the authenticated user
|
||||
PlayerAuth auth = plugin.database.getAuth(playerName.toLowerCase());
|
||||
if (auth == null) {
|
||||
m.send(sender, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Show the email address
|
||||
sender.sendMessage("[AuthMe] " + playerName + "'s email: " + auth.getEmail());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ public class LastLoginCommand extends ExecutableCommand {
|
||||
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
|
||||
// AuthMe plugin instance
|
||||
AuthMe plugin = AuthMe.getInstance();
|
||||
|
||||
// Messages instance
|
||||
Messages m = Messages.getInstance();
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ public class RegisterCommand extends ExecutableCommand {
|
||||
public boolean executeCommand(final CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
|
||||
// AuthMe plugin instance
|
||||
final AuthMe plugin = AuthMe.getInstance();
|
||||
|
||||
// Messages instance
|
||||
final Messages m = Messages.getInstance();
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ public class ReloadCommand extends ExecutableCommand {
|
||||
|
||||
// AuthMe plugin instance
|
||||
AuthMe plugin = AuthMe.getInstance();
|
||||
|
||||
// Messages instance
|
||||
Messages m = Messages.getInstance();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user