mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-07 11:10:04 +01:00
Fix '/is bans' showing invalid players
This commit is contained in:
parent
15667c8635
commit
c89be5cc73
@ -8,6 +8,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import me.goodandevil.skyblock.utils.player.OfflinePlayer;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
|
||||||
@ -45,7 +46,12 @@ public class Ban {
|
|||||||
.getConfig(new File(new File(skyblock.getDataFolder().toString() + "/ban-data"),
|
.getConfig(new File(new File(skyblock.getDataFolder().toString() + "/ban-data"),
|
||||||
islandOwnerUUID.toString() + ".yml"))
|
islandOwnerUUID.toString() + ".yml"))
|
||||||
.getFileConfiguration().getStringList("Bans")) {
|
.getFileConfiguration().getStringList("Bans")) {
|
||||||
islandBans.add(UUID.fromString(islandBanList));
|
|
||||||
|
UUID uuid = UUID.fromString(islandBanList);
|
||||||
|
if (!Bukkit.getOfflinePlayer(uuid).hasPlayedBefore())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
islandBans.add(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
return islandBans;
|
return islandBans;
|
||||||
|
@ -216,7 +216,12 @@ public class Bans {
|
|||||||
targetPlayerTexture = offlinePlayer.getTexture();
|
targetPlayerTexture = offlinePlayer.getTexture();
|
||||||
} else {
|
} else {
|
||||||
targetPlayerName = targetPlayer.getName();
|
targetPlayerName = targetPlayer.getName();
|
||||||
|
|
||||||
|
if (playerDataManager.hasPlayerData(targetPlayer)) {
|
||||||
targetPlayerTexture = playerDataManager.getPlayerData(targetPlayer).getTexture();
|
targetPlayerTexture = playerDataManager.getPlayerData(targetPlayer).getTexture();
|
||||||
|
} else {
|
||||||
|
targetPlayerTexture = new String[] { null, null };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nInv.addItem(
|
nInv.addItem(
|
||||||
|
@ -220,7 +220,12 @@ public class Coop {
|
|||||||
targetPlayerTexture = offlinePlayer.getTexture();
|
targetPlayerTexture = offlinePlayer.getTexture();
|
||||||
} else {
|
} else {
|
||||||
targetPlayerName = targetPlayer.getName();
|
targetPlayerName = targetPlayer.getName();
|
||||||
|
|
||||||
|
if (playerDataManager.hasPlayerData(targetPlayer)) {
|
||||||
targetPlayerTexture = playerDataManager.getPlayerData(targetPlayer).getTexture();
|
targetPlayerTexture = playerDataManager.getPlayerData(targetPlayer).getTexture();
|
||||||
|
} else {
|
||||||
|
targetPlayerTexture = new String[] { null, null };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nInv.addItem(
|
nInv.addItem(
|
||||||
|
Loading…
Reference in New Issue
Block a user