mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-20 15:47:38 +01:00
Kick player only Synchronously
This commit is contained in:
parent
121dd7e6fb
commit
e97b4641a1
@ -1,15 +1,17 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.CommandService;
|
||||
import fr.xephi.authme.command.ExecutableCommand;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Admin command to register a user.
|
||||
@ -55,10 +57,16 @@ public class RegisterAdminCommand implements ExecutableCommand {
|
||||
|
||||
commandService.send(sender, MessageKey.REGISTER_SUCCESS);
|
||||
ConsoleLogger.info(sender.getName() + " registered " + playerName);
|
||||
Player player = commandService.getPlayer(playerName);
|
||||
final Player player = commandService.getPlayer(playerName);
|
||||
if (player != null) {
|
||||
sender.getServer().getScheduler().scheduleSyncDelayedTask(AuthMe.getInstance(), new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run() {
|
||||
player.kickPlayer("An admin just registered you, please log in again");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user