private static void sendPlayerThirstMessage(Player player) { String message = "" + ChatColor.YELLOW; if (player.getLevel() == Settings.getConfig().getInt(Thirst.PARCH_1)) { player.sendMessage(message + Messages.getConfig().getString(Thirst.PARCH_1_MSG)); } else if (player.getLevel() == Settings.getConfig().getInt(Thirst.PARCH_2)) { player.sendMessage(message + Messages.getConfig().getString(Thirst.PARCH_2_MSG)); } else if (player.getLevel() == Settings.getConfig().getInt(Thirst.PARCH_3)) { player.sendMessage(message + Messages.getConfig().getString(Thirst.PARCH_3_MSG)); } else if (player.getLevel() == Settings.getConfig().getInt(Thirst.PARCH_4)) { player.sendMessage(message + Messages.getConfig().getString(Thirst.PARCH_4_MSG)); } }
public static void calculateThirstDamage() { Player[] players = plugin.getServer().getOnlinePlayers(); for (Player player : players) { if (Thirst.isAllowed(player) && player.getLevel() == 0) { if (!player.isOp() || !Settings.getConfig().getBoolean("world.op-is-god")) { player.damage(Settings.getConfig().getInt(Thirst.DAMAGE_HIT)); } if (player.getHealth() == Settings.getConfig().getInt(Thirst.DEATH_LVL)) { player.sendMessage(ChatColor.RED + Messages.getConfig().getString(Thirst.DEATH_MSG)); } } } }