Fixed the default action bar cycling for offline playerdata

This commit is contained in:
Aria 2019-10-21 06:50:59 +02:00
parent 83466f92f9
commit ec3e5c21e0

View File

@ -268,7 +268,7 @@ public class MMOCore extends JavaPlugin {
//System.out.println("Tick!"); //System.out.println("Tick!");
for (PlayerData data : PlayerData.getAll()) { for (PlayerData data : PlayerData.getAll()) {
if(!data.isCasting() && !pausePlayers.contains(data.getUniqueId())) { if (data.isOnline() && !data.getPlayer().isDead() && !data.isCasting() && !pausePlayers.contains(data.getUniqueId())) {
//System.out.println("Display!"); //System.out.println("Display!");
data.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(placeholderParser.parse(data.getPlayer(), ChatColor.translateAlternateColorCodes('&', getConfig().getString("action-bar.format") data.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(placeholderParser.parse(data.getPlayer(), ChatColor.translateAlternateColorCodes('&', getConfig().getString("action-bar.format")
.replace("{health}", format.format(data.getPlayer().getHealth())).replace("{max_health}", "" + StatType.MAX_HEALTH.format(data.getStats().getStat(StatType.MAX_HEALTH))) .replace("{health}", format.format(data.getPlayer().getHealth())).replace("{max_health}", "" + StatType.MAX_HEALTH.format(data.getStats().getStat(StatType.MAX_HEALTH)))