Implement SNBT write to file

This commit is contained in:
zontreck 2024-05-08 20:37:41 -07:00
parent daf9cb7376
commit 0766a43622

View file

@ -1 +1,14 @@
class SnbtIo {}
import 'dart:io';
import 'package:libac_flutter/nbt/Stream.dart';
import 'package:libac_flutter/nbt/Tag.dart';
import 'package:libac_flutter/nbt/impl/CompoundTag.dart';
class SnbtIo {
static void write(String file, CompoundTag tag) {
File handle = File(file);
StringBuilder builder = StringBuilder();
Tag.writeStringifiedNamedTag(tag, builder, 0);
handle.writeAsString(builder.toString());
}
}