#306 Create tests for CommandService and PlayerCommand
This commit is contained in:
@@ -7,6 +7,7 @@ import fr.xephi.authme.command.PlayerCommand;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.security.RandomString;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.util.Wrapper;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
@@ -17,10 +18,12 @@ public class CaptchaCommand extends PlayerCommand {
|
||||
public void runCommand(Player player, List<String> arguments, CommandService commandService) {
|
||||
final String playerNameLowerCase = player.getName().toLowerCase();
|
||||
final String captcha = arguments.get(0);
|
||||
final AuthMe plugin = AuthMe.getInstance();
|
||||
Wrapper wrapper = Wrapper.getInstance();
|
||||
final AuthMe plugin = wrapper.getAuthMe();
|
||||
PlayerCache playerCache = wrapper.getPlayerCache();
|
||||
|
||||
// Command logic
|
||||
if (PlayerCache.getInstance().isAuthenticated(playerNameLowerCase)) {
|
||||
if (playerCache.isAuthenticated(playerNameLowerCase)) {
|
||||
commandService.send(player, MessageKey.ALREADY_LOGGED_IN_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user