@Override
    public void saveUser(User user) throws IOException {
        user.normalData().discardChanges();
        try {
            if (!this.plugin.getUserManager().isNonDefaultUser(user)) {
                saveFile(StorageLocation.USERS, user.getUniqueId().toString(), null);
            } else {
                ConfigurationNode file = ConfigurationNode.root();
                if (this instanceof SeparatedConfigurateStorage) {
                    file.getNode("uuid").setValue(user.getUniqueId().toString());
                }

                String name = user.getUsername().orElse("null");
                String primaryGroup = user.getPrimaryGroup().getStoredValue().orElse(GroupManager.DEFAULT_GROUP_NAME);

                file.getNode("name").setValue(name);
                file.getNode(this.loader instanceof JsonLoader ? "primaryGroup" : "primary-group").setValue(primaryGroup);

                writeNodes(file, user.normalData().asList());
                saveFile(StorageLocation.USERS, user.getUniqueId().toString(), file);
            }
        } catch (Exception e) {
            throw new FileIOException(user.getUniqueId().toString(), e);
        }
    }
Saves a configuration node to the given location

@param location the location
@param name the name of the object
@param node the node
@throws IOException if an io error occurs
common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/AbstractConfigurateStorage.java