mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-09-06 20:28:06 +02:00
Minor improvement.
This commit is contained in:
parent
f7408c3e14
commit
ff17e4ca6b
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -38,9 +38,6 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
|
||||
if (needToChange) {
|
||||
player.setOp(isOp);
|
||||
}
|
||||
try {
|
||||
player.getVehicle().eject();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
player.leaveVehicle();
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user