writeToFileSync static method
- String file,
- CompoundTag tag
Implementation
static void writeToFileSync(String file, CompoundTag tag) {
File handle = File(file);
if (handle.existsSync())
handle.deleteSync(); // Ensure we flush the file to 0 bytes
StringBuilder builder = StringBuilder();
Tag.writeStringifiedNamedTag(tag, builder, 0);
handle.writeAsStringSync(builder.toString());
}