From 270302bb4bda4d2d162b00650378e88b8c576c07 Mon Sep 17 00:00:00 2001 From: zontreck Date: Sun, 5 May 2024 23:31:49 -0700 Subject: [PATCH] Update write method signatures --- lib/nbt/NbtIo.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/nbt/NbtIo.dart b/lib/nbt/NbtIo.dart index 5d64f6b..f7ffcdd 100644 --- a/lib/nbt/NbtIo.dart +++ b/lib/nbt/NbtIo.dart @@ -33,11 +33,15 @@ class NbtIo { return Tag.readNamedTag(_io) as CompoundTag; } - static Future write(String file) async { + static Future write(String file, CompoundTag tag) async { + _io = ByteLayer(); + Tag.writeNamedTag(tag, _io); await _io.writeToFile(file); } - static Future writeCompressed(String file) async { + static Future writeCompressed(String file, CompoundTag tag) async { + _io = ByteLayer(); + Tag.writeNamedTag(tag, _io); await _io.compress(); await _io.writeToFile(file); }