1
mirror of https://github.com/Shiewk/SModeration.git synced 2026-04-28 05:54:16 +02:00

Add ban and kick commands

This commit is contained in:
Shy
2024-06-08 12:40:55 +02:00
parent 3ff874e244
commit 16e28b59e0
6 changed files with 207 additions and 6 deletions
@@ -15,14 +15,14 @@ public abstract class PlayerUtil {
public static @NotNull String offlinePlayerName(UUID uuid){
if (uuid.equals(UUID_CONSOLE)){
return "UUID_CONSOLE";
return "CONSOLE";
}
OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
return player.getName() == null ? uuid.toString() : player.getName();
}
public static @Nullable UUID offlinePlayerUUIDByName(String name){
final OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayerIfCached(name);// getOfflinePlayerIfCached(String) is safer (I have experience with getOfflinePlayer(String) returning wrong UUIDs)
final OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayerIfCached(name); // getOfflinePlayerIfCached(String) is safer (I have experience with getOfflinePlayer(String) returning wrong UUIDs)
if (offlinePlayer != null) {
return offlinePlayer.getUniqueId();
} else {