private void setFlag(final CommandSender sender, final String[] args) throws CommandException {
        if (args.length < 2) {
            throw new CommandException(Translations.get(Message.error_input_world_name));
        }

        if (args.length < 4) {
            throw new CommandException(Translations.get(Message.error_input_flag));
        }

        if (args.length < 5) {
            throw new CommandException(Translations.get(Message.error_input_flag_value));
        }

        String world = args[1];
        String flag = args[3];
        String value = args[4];

        if (Bukkit.getWorld(world.toLowerCase()) == null) {
            Translations.get(Message.error_input_world_not_found, world);
        }

        boolean valueFlag;
        // reverse values, prevent true
        switch (value.toLowerCase()) {
            case "true":
                valueFlag = false;
                break;
            case "false":
                valueFlag = true;
                break;
            default:
                throw new CommandException(Translations.get(Message.error_input_flag_invalid_value));
        }

        Flag prevent;
        try {
            prevent = Flag.valueOf(flag);
        } catch (IllegalArgumentException ex) {
            throw new CommandException(Translations.get(Message.error_input_flag_unknown, flag));
        }

        if (sender.hasPermission(Permission.admin)) {
            manager.setWorldFlag(world, prevent, valueFlag);
            String flagState = valueFlag ? Translations.get(Message.flag_true) : Translations.get(Message.flag_false);
            sender.sendMessage(Translations.get(Message.success_world_flag_set, flag, world, flagState));
        } else {
            throw new CommandException(Translations.get(Message.error_no_permission));
        }
    }