use of org.spongepowered.configurate.NodePath in project SpongeCommon by SpongePowered.
the class FileMovingConfigurationTransformation method apply.
@Override
public void apply(@NonNull final ConfigurationNode oldConfig) throws ConfigurateException {
final ConfigurationNode newConfig = this.destinationLoader.load();
boolean acted = false;
for (final NodePath path : this.paths) {
final ConfigurationNode source = oldConfig.node(path);
if (!source.virtual()) {
acted = true;
if (this.override) {
newConfig.node(path).from(source);
} else {
newConfig.node(path).mergeFrom(source);
}
source.raw(null);
}
}
if (acted) {
this.destinationLoader.save(newConfig);
}
}
Aggregations