diff --git a/src/main/java/fr/xephi/authme/DataManager.java b/src/main/java/fr/xephi/authme/DataManager.java index 0545611d7..b518ea992 100644 --- a/src/main/java/fr/xephi/authme/DataManager.java +++ b/src/main/java/fr/xephi/authme/DataManager.java @@ -6,7 +6,6 @@ import fr.xephi.authme.settings.properties.PurgeSettings; import fr.xephi.authme.util.Utils; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; -import org.bukkit.entity.Player; import java.io.File; import java.util.ArrayList; @@ -145,19 +144,9 @@ public class DataManager { } int i = 0; for (String name : cleared) { - permsMan.removeAllGroups(getOnlinePlayerLower(name)); + permsMan.removeAllGroups(Utils.getPlayer(name)); i++; } ConsoleLogger.info("AutoPurge: Removed permissions from " + i + " player(s)."); } - - private Player getOnlinePlayerLower(String name) { - name = name.toLowerCase(); - for (Player player : Utils.getOnlinePlayers()) { - if (player.getName().equalsIgnoreCase(name)) { - return player; - } - } - return null; - } } diff --git a/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java b/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java index 3193ac498..bf7ab9676 100644 --- a/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java +++ b/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java @@ -38,9 +38,6 @@ public class ProcessSyncronousPlayerQuit implements Runnable { if (needToChange) { player.setOp(isOp); } - try { - player.getVehicle().eject(); - } catch (Exception ignored) { - } + player.leaveVehicle(); } } diff --git a/src/main/java/fr/xephi/authme/util/Utils.java b/src/main/java/fr/xephi/authme/util/Utils.java index c399f6555..c9b472c3f 100644 --- a/src/main/java/fr/xephi/authme/util/Utils.java +++ b/src/main/java/fr/xephi/authme/util/Utils.java @@ -236,7 +236,7 @@ public final class Utils { } public static Player getPlayer(String name) { - return wrapper.getServer().getPlayerExact(name); + return wrapper.getServer().getPlayerExact(name); // bukkit will lowercase the input } public static boolean isNPC(Player player) {