From 756bedb371319175c2c5d516dddf040bcec8269d Mon Sep 17 00:00:00 2001 From: zontreck Date: Mon, 3 Feb 2025 12:29:57 -0700 Subject: [PATCH] Update NBT Dependency --- lib/Consts2.dart | 2 +- lib/Editor.dart | 6 ++++-- pubspec.yaml | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/Consts2.dart b/lib/Consts2.dart index d39d3d1..83dc225 100644 --- a/lib/Consts2.dart +++ b/lib/Consts2.dart @@ -1 +1 @@ -const VERSION = "1.1.020325+1153"; +const VERSION = "1.1.020325+1229"; diff --git a/lib/Editor.dart b/lib/Editor.dart index 36d6de4..ceb932e 100644 --- a/lib/Editor.dart +++ b/lib/Editor.dart @@ -137,9 +137,11 @@ class EditorState extends State { // 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; diff --git a/pubspec.yaml b/pubspec.yaml index 1410082..5b20676 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: nbteditor description: A Minecraft NBT Editor written in Flutter publish_to: "none" -version: 1.1.020325+1153 +version: 1.1.020325+1229 environment: sdk: ^3.6.1 @@ -12,7 +12,7 @@ dependencies: flutter_code_editor: ^0.3.2 libac_dart: hosted: https://git.zontreck.com/api/packages/AriasCreations/pub/ - version: ^1.4.012225+0413 + version: ^1.4.020325+1215 cupertino_icons: ^1.0.8 flutter_highlighting: ^0.9.0+11.8.0 flutter_treeview: @@ -21,14 +21,14 @@ dependencies: permission_handler: ^11.3.1 libacflutter: hosted: https://git.zontreck.com/api/packages/AriasCreations/pub/ - version: ^1.0.013125+1423 + version: ^1.0.020325+1224 file_selector: ^1.0.3 flutter_highlight: any dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + flutter_lints: ^5.0.0 flutter: uses-material-design: true