Update NBT Dependency

This commit is contained in:
zontreck 2025-02-03 12:29:57 -07:00
parent 31d6cee09b
commit 756bedb371
3 changed files with 9 additions and 7 deletions

View file

@ -1 +1 @@
const VERSION = "1.1.020325+1153";
const VERSION = "1.1.020325+1229";

View file

@ -137,9 +137,11 @@ class EditorState extends State<Editor> {
// String!!
CompoundTag ct = CompoundTag();
if (filePath.endsWith(".txt") || filePath.endsWith(".snbt")) {
ct = await SnbtIo.readFromFile(filePath) as CompoundTag;
var strData = await result!.readAsString();
ct = await SnbtIo.readFromString(strData) as CompoundTag;
} else {
ct = await NbtIo.read(filePath);
var data = await result!.readAsBytes();
ct = await NbtIo.readFromStream(data) as CompoundTag;
}
SessionData.ROOT_TAG = ct;