Fix '/is bans' showing invalid players

This commit is contained in:
Esophose 2019-08-17 14:55:00 -06:00
parent 15667c8635
commit c89be5cc73
3 changed files with 19 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import java.util.List;
import java.util.Set;
import java.util.UUID;
import me.goodandevil.skyblock.utils.player.OfflinePlayer;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
@ -45,7 +46,12 @@ public class Ban {
.getConfig(new File(new File(skyblock.getDataFolder().toString() + "/ban-data"),
islandOwnerUUID.toString() + ".yml"))
.getFileConfiguration().getStringList("Bans")) {
islandBans.add(UUID.fromString(islandBanList));
UUID uuid = UUID.fromString(islandBanList);
if (!Bukkit.getOfflinePlayer(uuid).hasPlayedBefore())
continue;
islandBans.add(uuid);
}
return islandBans;

View File

@ -216,7 +216,12 @@ public class Bans {
targetPlayerTexture = offlinePlayer.getTexture();
} else {
targetPlayerName = targetPlayer.getName();
targetPlayerTexture = playerDataManager.getPlayerData(targetPlayer).getTexture();
if (playerDataManager.hasPlayerData(targetPlayer)) {
targetPlayerTexture = playerDataManager.getPlayerData(targetPlayer).getTexture();
} else {
targetPlayerTexture = new String[] { null, null };
}
}
nInv.addItem(

View File

@ -220,7 +220,12 @@ public class Coop {
targetPlayerTexture = offlinePlayer.getTexture();
} else {
targetPlayerName = targetPlayer.getName();
targetPlayerTexture = playerDataManager.getPlayerData(targetPlayer).getTexture();
if (playerDataManager.hasPlayerData(targetPlayer)) {
targetPlayerTexture = playerDataManager.getPlayerData(targetPlayer).getTexture();
} else {
targetPlayerTexture = new String[] { null, null };
}
}
nInv.addItem(