mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-23 18:55:11 +01:00
add getPlayer method into Utils class
This commit is contained in:
parent
3e1c7edb2d
commit
9a79332933
@ -225,10 +225,10 @@ public class AuthMePlayerListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onPreLogin(AsyncPlayerPreLoginEvent event) {
|
||||
final String name = event.getName().toLowerCase();
|
||||
@SuppressWarnings("deprecation")
|
||||
final Player player = plugin.getServer().getPlayer(name);
|
||||
if (player == null)
|
||||
final Player player = Utils.getPlayer(name);
|
||||
if (player == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if forceSingleSession is set to true, so kick player that has
|
||||
// joined with same nick of online player
|
||||
|
@ -273,6 +273,12 @@ public class Utils {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static Player getPlayer(String name) {
|
||||
name = name.toLowerCase();
|
||||
return plugin.getServer().getPlayer(name);
|
||||
}
|
||||
|
||||
public static boolean isNPC(final Entity player) {
|
||||
try {
|
||||
if (player.hasMetadata("NPC")) {
|
||||
|
Loading…
Reference in New Issue
Block a user